Commit Graph

13 Commits

Author SHA1 Message Date
Eddie Schoute
5327841a18 Add pathlib.Path.__enter__ and __exit__ (#2048) 2018-04-12 10:39:19 -07:00
Guido van Rossum
af2fadc180 More fixes related to PathLike (#1061)
* Make DirEntry generic over AnyStr, and inherit from PathLike if it exists

* Make pathlib require PathLike[str] (when it exists)
2017-03-21 22:26:21 -07:00
Jelle Zijlstra
25464cf0a7 Merge pull request #991 from JetBrains/sproshev/pep-519
Update `open`, `os.fspath`, `os.fsencode`, `os.fsdecode`, `pathlib.PurePath` and `pathlib.Path` stubs due to PEP-519
2017-03-21 07:38:50 -07:00
Semyon Proshev
e4fdd0eb62 Update stubs for pathlib.PurePath and pathlib.Path classes due to PEP-519. 2017-03-13 18:35:50 +03:00
Jelle Zijlstra
984307bf45 fix odd version comparisons (#988)
"> (3,)" works but looks like the code is checking for Python 4.

"<= (3, 5)" was intended to check for versions up to and including 3.5, and probably works that
way in current type checkers. However, sys.version_info is actually a 5-tuple that is greater
than (3, 5), so a hypothetical type checker that uses the full version info would interpret
this check incorrectly.

This ensures that all version_info comparisons use <, >=, ==, or !=.
2017-03-12 20:48:48 -07:00
Ivan Levkivskyi
22c0353498 Add missing imports from typing (#933) 2017-02-14 10:59:00 -08:00
Lukasz Langa
67e38b6806 Fixing flake8 E231 errors 2016-12-19 23:53:19 -08:00
Lukasz Langa
b84f20a011 Fixing flake8 W errors 2016-12-19 21:52:56 -08:00
Philip House
04f5c5699e Merge 3.4 and 3.5 pathlib stubs (#764)
Fixes #659
2016-12-13 12:03:03 -08:00
Valérian Rousset
9b3fe3d0e0 add types to pathlib (#338) 2016-07-17 21:16:25 -07:00
Matthias Kramm
94c9ce8fd0 Consistently use '= ...' for optional parameters. 2015-11-09 13:55:02 -08:00
Matthias Kramm
4fe8915d44 Add missing '-> None' to all __init__ methods. 2015-11-09 10:25:11 -08:00
Matthias Kramm
337abed05a add (overwrite with) mypy stubs, if available 2015-09-30 09:59:44 -07:00