Commit Graph

226 Commits

Author SHA1 Message Date
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
Jelle Zijlstra
6f6fa428ce fix some issues found by stubcheck (#1303)
- ThreadError exists (undocumented) on Python 3. It's an alias for _thread.error,
  but making it a separate exception seems fine.
- zipfile.error is an alias for BadZipFile on both Python versions.
- zlib.Compress and Decompress are not actually accessible at runtime.
2017-05-23 12:44:35 -07:00
Jelle Zijlstra
0aa7138c4e fixes to logging stubs (#1302)
Found with my stubcheck tool
2017-05-23 12:43:49 -07:00
Emily Morehouse
efec7d67e8 Removed SAX classes from xml/__init__.pyi (#1299)
- Removed class definitions from `xml/__init__.pyi` as they were merely outdated duplicates of the definitions from the correct file (`xml/sax/__init__.pyi`)
- Left file intact as it is necessary for the module
2017-05-22 16:08:08 -07:00
amstree
028f2dd0a4 add captureWarnings to stdlib logging (#1298)
Fixes #1235
2017-05-22 15:57:40 -07:00
Emily Morehouse
adae702fc1 Moves pdb stub to 2and3 (#1294)
- Moves the pdb stub from separate `2`/`3` files to a single file in `2and3`, as they were identical.
- Maintains the comment header, as the stub is incomplete.
2017-05-22 15:48:14 -07:00
Emily Morehouse
b6d08b81a3 #1286 Remove header comments from stubs (#1292)
- Updates documentation related to previously required comment headers.
- Removes all comment headers from stubs
- Occasionally included a header for stubs that were noted to be incomplete or contained todo's.
2017-05-22 15:14:15 -07:00
Jelle Zijlstra
8d1114c0c3 allow string levels in logging (#1234)
* allow string levels in logging

* remove redundant Union member
2017-05-10 07:09:08 -07:00
Jelle Zijlstra
7dd2f80194 Fixes to ContextManager (#1249)
* add typing.ContextManager for 3.6+ only

This fixes the easier part of #655.

Would it make sense to add a generic typing.ContextManager that exists in any Python version?

* update comment

* fix argument types for ContextManager.__exit__

* add AsyncContextManager

* add @asynccontextmanager

* typing.ContextManager now always exists

* back out async-related changes

Will submit those in a separate PR later

* fix import order

* AbstractContextManager only exists in 3.6+

* AbstractContextManager -> ContextManager
2017-05-08 16:21:51 -07:00
Joe Bateson
385b9c8b66 Fix optparse OptionGroup __init__ to allow missing description (#1248) 2017-05-06 12:39:55 -07:00
Guido van Rossum
b6a9a05743 Turn uidl() into an overload. (#1231)
The previous change was still right. Unique among `poplib` functions, `uidl()` returns a long response when called without arguments, but just a bytes string when called with a `which` argument.
2017-05-01 08:56:27 -07:00
Jelle Zijlstra
238c869965 merge _codecs into 2and3 (#1228)
* merge _codecs into 1and3

* handle encoding maps correctly
2017-05-01 07:51:08 -07:00
Jelle Zijlstra
7be1a6f1fd fix some types in poplib (#1225)
Fixes a problem introduced in #1211.
2017-04-30 08:56:42 -07:00
Jelle Zijlstra
ee0f341ecb stub for poplib (#1211)
* stub for poplib

* poplib: str -> Text
2017-04-27 09:51:29 -07:00
Jelle Zijlstra
1d6e3f492e Fix incorrect usage of AnyStr (#1215)
* Fix incorrect usage of AnyStr

- sqlite3 was using Union[bytes, AnyStr], which doesn't make sense
- The urllib functions I changed accept either bytes or str for their "safe"
  argument
- Also added supports for PathLike to pstats
- Remove some unused imports of AnyStr

* pstats: python 2 accepts unicode
2017-04-27 08:47:59 -07:00
Jelle Zijlstra
d394d8c6bf stub for pickletools (#1210) 2017-04-27 08:14:21 -07:00
Ivan Levkivskyi
c133a3aca7 First argument to traceback.extract_tb can be None (#1223)
* First argument to traceback.extract_tb can be None

* Add Optional also to print_tb, format_tb, and walk_tb
2017-04-27 08:07:40 -07:00
Jelle Zijlstra
6f5c6b5078 add some missing constants (#1198)
Closes #2
2017-04-24 15:05:02 -07:00
Jelle Zijlstra
8f1875b97b fixes to xml.sax (#1201) 2017-04-24 15:03:07 -07:00
Jelle Zijlstra
e8e002d9c0 stubs for smtpd (#1203) 2017-04-24 15:02:51 -07:00
Jelle Zijlstra
0fcece539b Stubs for sched (#1204)
* stubs for sched

* can't use NamedTuple classes
2017-04-24 15:02:25 -07:00