Commit Graph

246 Commits

Author SHA1 Message Date
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
Matthias Kramm
a02f9b6d46 switch order of ContextManager and Generic (#1382)
Since ContextManager inherits from Generic, too, listing Generic first, in the list of base classes, results in a cyclic MRO.
2017-06-01 18:06:43 -07:00
Yusuke Miyazaki
35852bd687 Update stub for grp (#1373) 2017-06-01 17:36:32 -07:00
Alex Grönholm
37fc02ea7e Made Logger methods accept BaseExceptions for exc_info (#1376)
Loggers accept any exceptions as the exc_info argument, not only Exception subclasses.
2017-05-31 20:00:56 -07:00
Yusuke Miyazaki
193e6885d4 Update stub for spwd (#1372)
Update stub for spwd

- Use `NamedTuple`
- Fix stub for Python 3
  - Some attributes are changed from Python 2
    - `sp_nam` -> `sp_namp`
    - `sp_pwd` -> `sp_pwdp`
2017-05-31 12:07:21 -07:00
Yusuke Miyazaki
40c6927cf0 Update stub for pwd (#1371) 2017-05-30 21:43:30 -07:00
Jelle Zijlstra
9bbcb0822d add difflib.diff_bytes and difflib.Match (#1336) 2017-05-26 09:32:34 -07:00
Jelle Zijlstra
f8d06c88e5 fix reverse comparison in optparse (#1337) 2017-05-26 09:31:30 -07:00
Jelle Zijlstra
296f294b75 add fileinput.filelineno and fileinput.fileno (#1338) 2017-05-26 09:30:42 -07:00
Jelle Zijlstra
fefdf185c7 merge and complete linecache stubs (#1320) 2017-05-26 08:30:42 -07:00
Jelle Zijlstra
c31dcf4088 Add more flags to socket (#1348)
Also switch to PEP 526-style types in socket.
2017-05-26 08:25:20 -07:00
Jelle Zijlstra
2800002ebf add to calendar stub (#1359) 2017-05-26 06:27:08 -07:00
Jelle Zijlstra
aeb19baa84 add symtable.symtable (#1360)
https://docs.python.org/3/library/symtable.html#symtable.symtable
and
https://docs.python.org/2/library/symtable.html#symtable.symtable
2017-05-25 19:39:15 -07:00
Jelle Zijlstra
3ed17cdb49 distutils.core.setup fixes (#1358)
- add include_package_data (which setuptools accepts)
- allow arbitrary other kwargs, because distutils.core.setup allows arbitrary kwargs and just passes them through to commands
2017-05-25 19:37:10 -07:00
Matěj Cepl
367743adf0 Python 3 adds short_empty_elements attribute to xml.sax.saxutils.XMLGenerator. (#1265)
Fix #1265
2017-05-25 08:53:01 -07:00
Jelle Zijlstra
875b02e374 complete and merge weakref stubs (#1343) 2017-05-24 20:35:16 -07:00
Jelle Zijlstra
383d1dc9e1 mark cProfile as private in pstats.pyi (#1344) 2017-05-24 20:33:20 -07:00
Jelle Zijlstra
d9bf214203 merge pickle stubs into 2and3 (#1328)
Followup from #1321
2017-05-24 14:57:58 -07:00
Jelle Zijlstra
6fe7cdb1c3 merge 2and3 stubs for select (#1333)
There don't seem to be significant changes between Python 2 and 3. The Python 2
stub was much better, so I mostly built off of it.
2017-05-24 14:57:11 -07:00
Jelle Zijlstra
97f32a57a2 complete __future__ stubs (#1326)
We were missing the most important one.
2017-05-24 08:02:47 -07:00
Jelle Zijlstra
c930e889ee merge 2 and 3 stubs for fileinput (#1319)
* merge 2 and 3 stubs for fileinput

Plus some minor fixes.

* pytype doesn't like generic type aliases
2017-05-24 07:58:56 -07:00
Jelle Zijlstra
cca81d864a complete doctest stub (#1315)
* complete doctest stub

And merge it into 2and3 (the old stubs were virtually empty).

* note things changed in 3.4

2.7 also had an undocumented and deprecated doctest.Tester class. I'm going to leave it out until somebody asks for it to be added.
2017-05-23 16:34:34 -07:00
Jelle Zijlstra
9ae9a9e741 merge Python 2 and 3 stubs for difflib (#1313)
These were already virtually identical.

I didn't review the stubs themselves for correctness. I'll make some changes after this
PR is in.
2017-05-23 15:01:30 -07:00
Jelle Zijlstra
1dda4ac105 merge python 2 and 3 stubs for calendar (#1310)
These are pretty much the same in the stdlib, except that TimeEncoding
got renamed to different_locale.
2017-05-23 12:47:24 -07:00