hashstat
6accffca28
popen() is function, not method, so remove self argument ( #1671 )
2017-10-12 12:16:14 -07:00
Guido van Rossum
05ffb1f912
Make initial_indent and subsequent_indent AnyStr in wrap() and fill() ( #1662 )
...
Leave them alone in TextWrap.__init__(), since I don't want to make the whole class generic.
2017-10-10 15:11:48 -07:00
Guido van Rossum
6d619e013c
Add textwrap.dedent() to Py2 stubs ( #1661 )
2017-10-10 10:07:18 -07:00
FichteFoll
8b6234ad2c
Use self-type in asyncio.Future.*_done_callback ( #1614 )
2017-10-10 10:06:57 -07:00
hashstat
d333474ed9
Update and add stubs for os module ( #1645 )
2017-10-09 21:02:10 -07:00
hashstat
0349f9becd
Add additional type annotations to ipaddress stub ( #1654 )
...
Makes heavier use of generics to minimize code. Fixes some incorrect
types. Also reordered to allow easy comparison against class listings
and documentation.
2017-10-09 21:00:07 -07:00
hashstat
29473745a8
Implement array.array as a MutableSequence ( #1649 )
...
It also improves the type checking of contained values. Some methods
were removed because they are implemented by a base class (i.e.,
*__iter__()*, *__str__()*, and *__contains__()*). *__hash__()* was
removed because arrays are unhashable types.
2017-10-09 10:12:01 -07:00
Suren Nihalani
898299969c
typeshed: declare that ordereddict's copy returns ordereddict ( #1656 )
2017-10-08 21:15:11 -07:00
Michael Lee
51829c1bc8
Update textwrap stubs ( #1634 )
...
This commit adds a few missing return types to the Python 3 textwrap
stubs and fleshes out the Python 2 textwrap stubs so they're on par with
the Python 3 version.
This change:
1. Changes the order of the arguments in Python 2 and Python 3
to match the order from the source code instead of the
documentation.
2. Adds other undocumented attributes besides whitespace_trans
(for consistency).
3. Moves the '*' argument in TextWrapper.__init__ for Python 3
to match the source code.
4. Made function stub formatting consistent with typeshed style
conventions.
2017-10-08 21:12:19 -07:00
hashstat
0917560195
Add new methods to socket stubs. ( #1638 )
...
* Add new methods to socket stubs.
Also fix a couple of invalid types in recv*_into() socket methods.
* Add double-underscores to parameters for position-only arguments
2017-10-07 08:41:06 -07:00
Semyon Proshev
bc91a22e4e
Update datetime.timetuple and datetime.utctimetuple (Py3), and datetime.__init__ (Py2) ( #1648 )
...
* Update return type for datetime.timetuple and datetime.utctimetuple
* Fix microsecond parameter in datetime
2017-10-07 08:39:39 -07:00
hashstat
97b16a0b34
itertools.count() can take floats as well as ints ( #1650 )
2017-10-07 08:30:07 -07:00
Ashwini Chaudhary
c03e3a7ac0
Added stub for whichdb(py2) ( #1508 )
...
Added stub for whichdb(py2)
2017-10-06 19:04:18 -07:00
Travis Parker
355f30cc70
Correct return type of sum() builtin ( #1582 )
...
`sum([])` always returns the integer 0.
2017-10-04 21:42:35 -07:00
Naman Bharadwaj
000041761e
month, day parameters to datetime.datetime are required (#1633 )
2017-10-04 21:38:09 -07:00
hashstat
f48731ac7a
Add stub for standard library crypt module ( #1641 )
2017-10-04 20:39:33 -07:00
hashstat
6661377597
Ensure AF_*, SOCK_*, AI_*, and MSG_* constants use enum types ( #1637 )
2017-10-04 08:55:36 -07:00
hashstat
fc74f53c5a
Corrects timeout type annotations. ( #1639 )
...
Timeouts should be floats, but were ints for some reason.
2017-10-04 08:40:40 -07:00
hashstat
15f737d2a8
Corrects return type of warnings.formatwarning(). ( #1640 )
2017-10-04 08:37:08 -07:00
Gábor Bernát
f1a01b3017
[XML] iterparse is None for end-ns, Tuple[str, str] for start-ns, Element otherwise ( #1520 )
2017-10-04 08:24:27 -07:00
Carl Meyer
a19d4e34c3
Add 3-argument overload for asyncio.gather. ( #1644 )
2017-10-03 11:41:25 -07:00
Jelle Zijlstra
78587dc895
Revert "make __class__ refer to the current object's class ( #1549 )" ( #1632 )
...
This reverts commit 1a164b630c .
Reverts python/typeshed#1549 .
See Guido's comments in the original PR.
2017-09-29 11:37:54 -07:00
Jelle Zijlstra
1a164b630c
make __class__ refer to the current object's class ( #1549 )
...
Fixes python/mypy#3061
2017-09-27 18:11:59 -07:00
Martin DeMello
d389ef3d85
Remove a few files from the pytype blacklist. ( #1628 )
...
Fixes the following issues:
* Literals rather than ... for default values
* None rather than ... for default value of typed variable
* Literals rather than ... # type for top level constants
* # Foo rather than # type: Foo
* return value of init not set to None
2017-09-27 07:57:13 -07:00
daid
d14272a14f
Fix the typing for clock_settime ( #1629 )
...
clock_settime expects a float as parameter, and returns nothing.
2017-09-27 07:52:50 -07:00
Neil Pilgrim
ffe2bee7a7
Fix email.utils parseaddr and formataddr to accept Optional[str] ( #1626 )
2017-09-26 14:10:35 -07:00
Ben Leslie
b8f7ba8e8a
Corrections to logging.StreamHandler stubs ( #1624 ) ( #1625 )
...
- Missing attribute `StreamHandler.stream`
- Missing attribute `StreamHandler.terminator`
- terminator is only available in 3.3+
2017-09-23 18:36:51 -04:00
Luka Sterbic
1f867d8ab8
Fix int(Union[str, int]) ( #1551 )
2017-09-23 09:59:15 -04:00
Pieter-Jan Briers
d7533152f9
(3.6+) Adds re.RegexFlag and use it. ( #1592 )
...
* Make 3.6 functions take Union[int, RegexFlag] instead.
2017-09-23 08:58:31 -04:00
Øystein Olsen
6bfd43d6b6
Update utime stub ( #1594 )
...
times can be either a tuple of ints or floats
2017-09-23 08:57:38 -04:00
Bruce Merry
55dbb967ad
Corrections to the asyncio exception stubs ( #1623 )
...
Fixes #1622 :
- Missing attribute `LimitOverrunError.consumed`
- Missing attribute `IncompleteReadError.expected` and `.partial`
- `partial` argument to `IncompleteReadError` had incorrect type
- `expected` argument to `IncompleteReadError` missing `Optional`
2017-09-22 07:47:17 -07:00
Melvyn Sopacua
ebed7c2ecb
Codeobject support ( #1606 )
2017-09-22 06:54:58 -07:00
Matthias Kramm
03ec4023ff
Adjust ast imports to make pytype happy. ( #1617 )
...
Turns out that pytype is a bit more finicky about imports, and
differentiates between '*' imports for export, and imports
for use in the local pyi. This adjusts ast.pyi to make pytype
understand it again.
2017-09-22 06:27:27 -07:00
Amandine Lee
248f74d31b
ConfigParser should use IO[str] for IO functions ( #1621 )
2017-09-22 06:25:17 -07:00
David Novakovic
b4e89a078c
Second param of islice allows None. ( #1603 )
2017-09-20 14:55:16 -07:00
rchen152
3d505d0c6b
Re-export exception names in exceptions.pyi ( #1611 )
2017-09-19 15:19:40 -07:00
FichteFoll
cc3e753202
All loop kwargs in asyncio.streams are optional ( #1615 )
...
I verified this with the module code. All these loop arguments default
to `None` and are set with `events.get_event_loop()` if this is the
case.
2017-09-18 07:51:25 -07:00
rchen152
c009caf316
Make exceptions.pyi import its definitions from __builtin__.pyi ( #1610 )
...
* Make exceptions.pyi import its definitions from __builtin__.pyi
* Make ReferenceError a full class again.
* Restore blank line at EOF.
2017-09-15 14:52:54 -07:00
rchen152
0bf2958257
Correct a typo in stdlib/2/symbol.pyi ( #1607 )
2017-09-14 14:33:20 -07:00
Dominik Gabi
693509bff6
Change Union[float, None] to Optional in socket.pyi ( #1602 )
2017-09-13 13:23:54 -07:00
rchen152
1dfa570cae
Fix the definition of nlargest() in stdlib/2/heapq.pyi ( #1601 )
...
* Fix nlargest() in stdlib/2/heapq.pyi
* Fix nlargest() syntax
* key can be None in heapq.nlargest
2017-09-12 08:27:41 -07:00
Mikołaj Biel
022da963b0
update shlex (python 3.6 updates) ( #1599 )
...
Update shlex to be compatible with changes from python 3.6: https://docs.python.org/3/library/shlex.html
Those changes should fix issues I've encountered:
```
main.py:10: error: No overload variant of "list" matches argument types [shlex.shlex]
main.py:10: error: Unexpected keyword argument "punctuation_chars" for "shlex"
/usr/local/lib/mypy/typeshed/stdlib/3/shlex.pyi:29: note: "shlex" defined here
```
caused by
```python
list(shlex(string, posix=True, punctuation_chars=True))
```
2017-09-11 12:30:48 -07:00
Elazar Gershuni
d4b21efbe8
Derive EnumMeta from ABCMeta ( #1598 )
...
Avoid inconsistent metaclass structure for enum mixins due to #1595 - e.g. mypy/#2824
2017-09-10 17:44:53 -07:00
John Reese
6865c24a4c
Add support for multiprocessing.get_context().Process() ( #1581 )
2017-09-05 20:11:21 -07:00
Zack Hsi
a4285af4c2
Support PathLike argument to os.path.split ( #1588 )
2017-09-05 20:04:55 -07:00
rchen152
fd8be43044
Fix the return type of functools.update_wrapper() ( #1589 )
2017-09-05 20:03:51 -07:00
rchen152
8d5a233c6b
Fix the definition of itertools.tee() ( #1584 )
2017-09-05 16:21:14 -07:00
Daniel Watkins
28d71e6f6f
Flesh out smtplib types further ( #1558 )
...
This fixes all current partial signatures, as well as adding anything
that I happened to have to work out whilst fixing those partial
signatures.
The stubs remain incomplete.
2017-08-29 22:57:59 -07:00
Liran Nuna
c5f1e907fa
More precisely typehint asyncio.gather up to 5 params ( #1550 )
2017-08-28 21:37:51 -07:00
Daniel Watkins
258b9fb821
Add IOBase to types fcntl will accept as files ( #1556 )
...
* Remove unused typing import from stdlib/3/fcntl.pyi
* Add IOBase to types fcntl will accept as files
Anything that implements a fileno() method is acceptable (per
https://github.com/python/cpython/blob/master/Objects/fileobject.c#L168-L173 ),
and IOBase fits the bill.
Fixes #1548 .
2017-08-28 21:29:57 -07:00