Patrick Valsecchi
d62743d788
Make traceback.FrameSummary Iterable ( #1741 )
...
To make this code valid:
```python
import traceback
for filename, lineno, name, line in traceback.extract_stack(stack):
pass
```
2017-11-13 07:05:16 -08:00
Jelle Zijlstra
83ca997140
Change more defaults to ... ( #1729 )
...
* codemod ': Any = None' ': Any = ...'
* codemod ': (Union|Optional)([^=]+)\s+=\s+-?\d+' ': \1\2 = ...'
* codemod ': (Union|Optional)([^=]+)\s*=\s*-?(None|False|True)' ': \1\2 = ...'
* codemod ': (int|float|bool)\s*=\s*-?\d+' ': \1 = ...'
* codemod ': (bool)\s*=\s*(False|True)' ': \1 = ...'
* codemod ': Any\s*=\s*(False|True|None)' ': Any = ...'
2017-11-13 06:56:24 -08:00
Jelle Zijlstra
0080017d02
fill out bz2 stub ( #1728 )
...
- add a default value to ...
- add some missing version checks
- add some missing arguments
2017-11-13 06:55:43 -08:00
FichteFoll
a44de46a00
use_builtin_types is optional for plistlib.load ( #1738 )
2017-11-11 16:54:11 -08:00
Jelle Zijlstra
97be335160
don't import enum in Python 2 ( #1724 )
...
* don't import enum in Python 2
Fixes a pytype issue from #1720 .
* move enums together
2017-11-10 10:23:22 -08:00
Jelle Zijlstra
324f1761f4
Change more defaults to ... ( #1727 )
2017-11-09 10:32:17 -08:00
Josh Staiger
fd25e534ad
Add default timeout for Condition.wait_for ( #1726 )
...
Fixes:
- Too few arguments for "wait_for" of "Condition"
when timeout is not specified.
2017-11-09 10:12:33 -08:00
Jelle Zijlstra
54dd6ba27c
Change numerous default values to ... ( #1722 )
...
This is the convention, and some default values (e.g. strings) apparently
break pytype.
2017-11-09 06:28:40 -08:00
Kenny Do
26ea6c0740
pkgutils.walk_packages takes optional list of str for path ( #1725 )
2017-11-09 05:57:29 -08:00
Josh Staiger
8b367c770b
Make pkgutil.get_data return Optional[bytes] ( #1714 )
...
As per the docs (and implementation):
- https://docs.python.org/3/library/pkgutil.html#pkgutil.get_data
If the package cannot be located or loaded ... then None is returned.
2017-11-05 14:00:51 -08:00
rchen152
85e75c9a6a
Fix a parameter type in threading.Thread.__init__ ( #1706 )
2017-11-01 15:41:10 -07:00
Matěj Cepl
8ead136300
IMAPlib stub. ( #1685 )
...
Fixes #295 .
2017-10-25 16:37:04 -07:00
hashstat
c366a1be55
Merge v2 and v3 array stubs ( #1670 )
...
See #1608
2017-10-25 09:46:25 -07:00
Sally
37f1bf54a5
Fix type of source for xml.sax.parse ( #1666 )
...
Fixes https://github.com/python/typeshed/issues/1655
2017-10-25 09:45:48 -07:00
marienz
c888bc8a1a
Fix distutils.setup's cmdclass argument ( #1682 )
2017-10-22 15:47:31 -04: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
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
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
Dominik Gabi
693509bff6
Change Union[float, None] to Optional in socket.pyi ( #1602 )
2017-09-13 13:23:54 -07:00
Robert T. McGibbon
f1a13cea9c
Add __init__ and __contains__ to argparse.Namespace ( #1578 )
2017-08-27 14:14:01 -07:00
Chris
875bfe4c2a
Allow Any return value for callbacks in retrbinary etc ( #1567 )
...
Fixes #1258
2017-08-25 20:40:45 -07:00
Guido van Rossum
76685480e0
Misc fixes found by running mypy against Dropbox internal codebase "C". ( #1575 )
2017-08-25 20:34:13 -07:00
Ashwini Chaudhary
4f14617db1
Add stub for codeop to 2and3 ( #1534 )
2017-08-11 17:09:57 -07:00
vim345
228615b307
fix the type definition of namer function ( #1498 )
2017-08-07 17:36:05 -06:00
Ashwini Chaudhary
c6bb8a7c88
Added stub for chunk(py 2 and 3) ( #1523 )
2017-08-06 08:21:09 -07:00
Matthias Kramm
3638bc1f52
Fix Python 2's traceback.format_exception, traceback.print_exception ( #1512 )
...
E.g. it's legal to call traceback.format_exception(None, None, None). In
particular, this change makes the following idiom type-check:
import traceback
import sys
exc_type, exc_value, exc_traceback = sys.exc_info()
traceback.format_exception(exc_type, exc_value, exc_traceback)
2017-08-03 15:58:34 -07:00
Luka Sterbic
34c8aa0d4c
traceback: use StackSummary where possible ( #1495 )
2017-07-26 08:27:43 -07:00
Jelle Zijlstra
74966bacd9
distutils: make Command classes non-abstract ( #1488 )
2017-07-19 20:28:16 +03:00
Jelle Zijlstra
ac651d2f8c
Fix a few TODOs ( #1487 )
...
* fix some easy TODOs
* fix io
2017-07-19 20:27:50 +03:00
Ashwini Chaudhary
11a479fd69
Add stub for formatter ( #1481 )
2017-07-18 19:19:14 -07:00
Thomas Grainger
2bb7ea9595
csv DictReader should only yield OrderedDicts in Py3.6 ( #1478 )
2017-07-14 21:58:52 -07:00
Thomas Grainger
7637549ced
fix DictReader definition ( #1475 )
...
* constructable with Iterable
* __iter__ returns another DictReader
* supports `__next__` on python 3
* supports `next` on python 2
2017-07-10 21:02:59 -07:00
Jelle Zijlstra
7ecc979211
locale: broaden type of val argument to format ( #1453 )
...
Fixes #1350
2017-07-04 19:21:12 -07:00
Jelle Zijlstra
fee2eaae30
xml.sax.saxutils: make some functions take AnyStr ( #1457 )
...
Fixes #1062
2017-07-04 19:18:43 -07:00
Jelle Zijlstra
2b97c02801
logging: make Logger inherit from Filterer ( #1448 )
...
Fixes #1401
2017-07-04 19:18:01 -07:00
Roy Williams
5a95e19322
Allow csv module to support both str and unicode types in Python 2 ( #1437 )
...
* Replace keys in DictReader with Any
2017-06-27 14:24:22 -07:00
Jelle Zijlstra
22f47fd478
add typing.AsyncContextManager and contextlib.asynccontextmanager ( #1432 )
...
Implements:
- https://github.com/python/typing/pull/438
- https://github.com/python/cpython/pull/360
Note that https://github.com/python/cpython/pull/1412 , which adds
contextlib.AbstractAsyncContextManager, has not yet been merged.
2017-06-27 10:39:40 -07:00
Harmen
d260bb4889
support for with socket.create_connection ( #1429 )
2017-06-24 09:11:12 -07:00
Elliot Marsden
2a115b1714
Indicate that float() accepts Real objects ( #1434 )
...
This contradicts CPython, in `Lib/numbers.py`, because `Real` does not
actually inherit from `SupportsFloat`. But it suppresses errors from
mypy when passing sub-classes like `fractions.Fraction` to `float()`.
2017-06-24 07:55:41 -07:00
Guido van Rossum
04fe184dcf
Add flags to pass on --warn-unused-ignores and --no-implicit-optional to mypy ( #1421 )
...
* Add flags to pass on --warn-unused-ignores and --no-implicit-optional to mypy
* Make implicit Optional explicit in arg types (2and3 part)
* Convert {stdlib,third_party}/2 to explicit Optional
2017-06-20 22:18:49 -07:00
amstree
b8a96045d9
add __init__ to Logger ( #1415 )
2017-06-20 13:17:26 -07:00
Ray Kraesig
44127444d4
asynchat + asyncore: Python 3 compatibility ( #1402 )
...
Includes an update to smtpd, which uses asynchat.
2017-06-20 13:15:58 -07:00
Guido van Rossum
86070643ac
Improve csv module and float() signature ( #1418 )
...
* DictReader should not be abstract. Reformat long lines.
* Make restval optional for DictWriter.__init__.
* The arg to reader() is *Iterable*, not *Iterator*.
* Improve signature of float() (use Union instead of overload).
2017-06-20 13:04:10 -07:00
Yusuke Miyazaki
1c8498228d
Update stub for csv ( #1398 )
2017-06-15 16:35:17 -07:00
Matthias Kramm
6849262df6
add _levelNames to logging/__init__.py ( #1404 )
...
* add _levelNames to logging/__init__.py
* add Python 3's _levelToName and _nameToLevel
2017-06-13 08:26:14 -07:00
Yusuke Miyazaki
8f476378e0
Update stub for tarfile ( #1389 )
2017-06-09 06:59:45 -07:00