🌐 AI搜索 & 代理 主页
Skip to content

Commit ad061b2

Browse files
committed
Convert to tool with args
1 parent 5c09ef0 commit ad061b2

30 files changed

+504
-12
lines changed

Lib/argparse.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# upstream_version: v3.13.7
12
# Author: Steven J. Bethard <steven.bethard@gmail.com>.
23
# New maintainer as of 29 August 2019: Raymond Hettinger <raymond.hettinger@gmail.com>
34

Lib/ast.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# upstream_version: v3.13.7
12
"""
23
The `ast` module helps Python applications to process trees of the Python
34
abstract syntax grammar. The abstract syntax itself might change with

Lib/decimal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# upstream_version: v3.13.7
12
"""Decimal fixed-point and floating-point arithmetic.
23
34
This is an implementation of decimal floating-point arithmetic based on

Lib/heapq.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# upstream_version: v3.13.7
12
"""Heap queue algorithm (a.k.a. priority queue).
23
34
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for

Lib/ipaddress.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# upstream_version: v3.13.7
12
# Copyright 2007 Google Inc.
23
# Licensed to PSF under a Contributor Agreement.
34

Lib/numbers.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# upstream_version: v3.13.7
12
# Copyright 2007 Google, Inc. All Rights Reserved.
23
# Licensed to PSF under a Contributor Agreement.
34

@@ -290,18 +291,27 @@ def conjugate(self):
290291

291292

292293
class Rational(Real):
293-
""".numerator and .denominator should be in lowest terms."""
294+
"""To Real, Rational adds numerator and denominator properties.
295+
296+
The numerator and denominator values should be in lowest terms,
297+
with a positive denominator.
298+
"""
294299

295300
__slots__ = ()
296301

297302
@property
298303
@abstractmethod
299304
def numerator(self):
305+
"""The numerator of a rational number in lowest terms."""
300306
raise NotImplementedError
301307

302308
@property
303309
@abstractmethod
304310
def denominator(self):
311+
"""The denominator of a rational number in lowest terms.
312+
313+
This denominator should be positive.
314+
"""
305315
raise NotImplementedError
306316

307317
# Concrete implementation of Real's conversion to float.

Lib/os.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# upstream_version: v3.13.7
12
r"""OS routines for NT or Posix depending on what system we're on.
23
34
This exports:
@@ -10,7 +11,7 @@
1011
- os.extsep is the extension separator (always '.')
1112
- os.altsep is the alternate pathname separator (None or '/')
1213
- os.pathsep is the component separator used in $PATH etc
13-
- os.linesep is the line separator in text files ('\r' or '\n' or '\r\n')
14+
- os.linesep is the line separator in text files ('\n' or '\r\n')
1415
- os.defpath is the default search path for executables
1516
- os.devnull is the file path of the null device ('/dev/null', etc.)
1617

Lib/pprint.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# upstream_version: v3.13.7
12
# Author: Fred L. Drake, Jr.
23
# fdrake@acm.org
34
#

Lib/queue.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# upstream_version: v3.13.7
12
'''A multi-producer, multi-consumer queue.'''
23

34
import threading
@@ -80,9 +81,6 @@ def task_done(self):
8081
have been processed (meaning that a task_done() call was received
8182
for every item that had been put() into the queue).
8283
83-
shutdown(immediate=True) calls task_done() for each remaining item in
84-
the queue.
85-
8684
Raises a ValueError if called more times than there were items
8785
placed in the queue.
8886
'''
@@ -239,9 +237,11 @@ def shutdown(self, immediate=False):
239237
By default, gets will only raise once the queue is empty. Set
240238
'immediate' to True to make gets raise immediately instead.
241239
242-
All blocked callers of put() and get() will be unblocked. If
243-
'immediate', a task is marked as done for each item remaining in
244-
the queue, which may unblock callers of join().
240+
All blocked callers of put() and get() will be unblocked.
241+
242+
If 'immediate', the queue is drained and unfinished tasks
243+
is reduced by the number of drained tasks. If unfinished tasks
244+
is reduced to zero, callers of Queue.join are unblocked.
245245
'''
246246
with self.mutex:
247247
self.is_shutdown = True

Lib/test/test_os.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# upstream_version: v3.13.7
12
# As a test suite for the os module, this is woefully inadequate, but this
23
# does add tests for a few functions which have been determined to be more
34
# portable than they had been thought to be.
@@ -829,9 +830,7 @@ def ns_to_sec(ns):
829830
# Convert a number of nanosecond (int) to a number of seconds (float).
830831
# Round towards infinity by adding 0.5 nanosecond to avoid rounding
831832
# issue, os.utime() rounds towards minus infinity.
832-
# XXX: RUSTPYTHON os.utime() use `[Duration::from_secs_f64](https://doc.rust-lang.org/std/time/struct.Duration.html#method.try_from_secs_f64)`
833-
# return (ns * 1e-9) + 0.5e-9
834-
return (ns * 1e-9)
833+
return (ns * 1e-9) + 0.5e-9
835834

836835
def test_utime_by_indexed(self):
837836
# pass times as floating-point seconds as the second indexed parameter

0 commit comments

Comments
 (0)