Commit Graph

21 Commits

Author SHA1 Message Date
Sebastian Rittau
4603728a15 Clean up files with former forced consistency (#4717)
Replace Text with str in Python 3 code
2020-10-27 07:52:35 +01:00
Utsav
6f943d43ea Added __class_getitem__ (#4695)
Resolves #4682

Co-authored-by: hauntsaninja <>
2020-10-22 14:05:04 -07:00
Jelle Zijlstra
5f9fd3d127 upgrade black version (#4486)
Manually removed a number of trailing commas to prevent black from unnecessarily
exploding some collections.
2020-08-26 18:36:01 +02:00
Shantanu
723fcb368a pathlib.Path.open: bring on the overloads (#4407) 2020-08-21 20:36:43 -07:00
Sebastian Rittau
06f87e5c92 Simplify pathlib (#4357)
* Enable some branches for Python2 pathlib2
* Define an alias _PathLike, instead of using multiple branches
* Drop a Python 3.4 branch (the Python 2 branch is identical to
  the 3.5+ branch)
* Move Path.__new__ to the top
2020-07-27 06:08:09 -07:00
Jelle Zijlstra
0142a87da8 adjust isort config (#4290)
Fixes #4288.

- Default imports to THIRD_PARTY, so in effect we merge the FIRST_PARTY and THIRD_PARTY stubs. This means import order is no longer affected by whether typing_extensions is installed locally.
- Treat typing_extensions, _typeshed and some others as standard library modules.

Note that isort master is very different from the latest release; we'll have to do something
different if and when the next isort release comes out.
2020-06-29 00:00:21 -07:00
Jelle Zijlstra
5d553c9584 apply black and isort (#4287)
* apply black and isort

* move some type ignores
2020-06-28 13:31:00 -07:00
Jelle Zijlstra
ea577cec1f move OpenTextMode and friends to _typeshed (#4213) 2020-06-10 15:36:21 +02:00
Shantanu
da2aa297a2 pathlib: update for py39 (#4134)
Co-authored-by: hauntsaninja <>
2020-05-28 13:41:53 -07:00
Ilaï Deutel
846d922df2 More precise return types for open(), Path.open(), bz2.open(), etc. (#3371)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2020-05-28 09:20:23 -07:00
Brian Turek
6e9e059f0c Add return type for pathlib.Path.replace on Python >= 3.8 (#3936) 2020-04-22 01:52:33 +02:00
Mickaël Schoentgen
b4d1da03aa Add missing Path.is_mount() introduced in Python 3.7 (#3566) 2020-01-05 16:04:52 +01:00
Jeppe Fihl-Pearson
fed3472e7c Reflect Python 3.8 updates to the pathlib stdlib module (#3568) 2020-01-03 08:47:50 -08:00
Sebastian Rittau
0501e2b329 Annotations for remaining Python 3.8 additions (#3358)
* Add os.add_dll_directory()
* Add memfd_create() and flags
* Add type annotation to flags
* Add stat_result.st_reparse_tag and flags
* Add ncurses_version
* Add Path.link_to()
* Add Picker.reducer_override()
* Add plistlib.UID
* Add has_dualstack_ipv6() and create_server()
* Add shlex.join()
* Add SSL methods and fields
* Add Python 3.8 statistics functions and classes
* Remove obsolete sys.subversion
* Add sys.unraisablehook
* Add threading.excepthook
* Add get_native_id() and Thread.native_id
* Add Python 3.8 tkinter methods
* Add CLOCK_UPTIME_RAW
* Add SupportsIndex
* Add typing.get_origin() and get_args()
* Add unicodedata.is_normalized
* Add unittest.mock.AsyncMock

Currently this is just an alias for Any like Mock and MagicMock. All of
these classes should probably be sub-classing Any and add their own
methods. See also #3224.

* Add unittest cleanup methods
* Add IsolatedAsyncioTestCase
* Add ElementTree.canonicalize() and C14NWriterTarget
* cProfile.Profile can be used as a context manager
* Add asyncio task name handling
* mmap.flush() now always returns None
* Add posonlyargcount to CodeType
2019-10-14 09:53:48 +02:00
Philippe F
ce0dc8a23d Add proper support for __rtruediv__ on libpath.Path (#3236) 2019-09-17 23:24:42 +02:00
Rebecca Chen
fab2ee0d7c Remove unnecessary quotes around forward references. (#3191) 2019-08-16 20:29:32 -07:00
Francis Colas
75d9228b02 PurePath methods accept os.PathLike[str] from 3.6 (#3099)
Closes #3095
2019-07-02 13:08:32 +02:00
Michael Lee
efb67946f8 Use variable annotations everywhere (#2909) 2019-04-13 10:40:52 +02:00
Daniel Li
254af0ff2a Add stub for pathlib2.Path.__div__ (#2507) 2018-10-16 07:31:58 +02:00
Daniel Li
631d2768d6 Add stub for pathlib2 on Python 2.7 (#2351)
pathlib2 is the Python 2.7 backport of the pathlib module from Python 3.
Hence we use the same stub file for both.

The maintainer of pathlib2 granted permission for stubs to be added in
mcmtroffaes/pathlib2#44.
2018-08-07 10:27:18 -07:00
Sebastian Rittau
9229dd8f0c Merge stdlib/3.4 into stdlib/3 (#2303)
* Merge stdlib/3.4 into stdlib/3

* Move asyncio back to 3.4 for now
2018-07-03 08:13:54 -07:00