Commit Graph

20 Commits

Author SHA1 Message Date
Alex Waygood
aa7e277adb Harmonise return type of builtins.__import__ and importlib.import_module (#6302)
builtins.__import__ now returns ModuleType instead of Any. In addition, add __getattr__() to ModuleType to ease using imported modules.
2021-11-15 16:21:46 +01:00
KotlinIsland
b8cbac800f Make types.coroutine return Awaitable (#6255) 2021-11-08 12:34:42 +01:00
Oz Anani
4601581e83 Update ModuleType.__file__ to be Optional (#6186)
Per the Python documentation, `ModuleType.__file__` is `Optional`: https://docs.python.org/3/reference/import.html#file__
2021-11-07 06:03:01 -08:00
Eric Werner
fd35084768 Update ModuleType to have __path__ (#6200)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-10-25 23:21:05 +03:00
Akuli
994b69ef8f Use lowercase tuple where possible (#6170) 2021-10-14 17:18:19 -07:00
KotlinIsland
b7d1d099d9 add TypeGuard to coroutines.iscoroutine (#6105)
make CoroutineType extend Coroutine
2021-10-09 17:01:36 +02:00
Kumar Aditya
25ae5b8871 Add __await__, name, qualname to CoroutineType (#6087) 2021-09-29 14:07:09 +02:00
Akuli
ce11072dbe Big diff: use lower-case list and dict (#5888) 2021-08-08 09:26:35 -07:00
Akuli
c12c93ebe4 use new union syntax in stdlib/types.pyi (#5882) 2021-08-08 15:46:09 +02:00
Bas van Beek
475417fa97 Mark final and unhashable classes in types as such (#5837) 2021-08-02 13:46:14 -07:00
Bas van Beek
95a45eb4ab Improve the annotations of types.MappingProxyType (#5822)
* Annotate three previously missing `MappingProxyType` methods

* `__hash__`
* `__reversed__`
* `__class_getitem__`

* Improve 5 `MappingProxyType` methods

The assumption here is that the underlying mapping is a `dict`,
just is done for `MappingProxyType.copy`

* Make the value type of `types.MappingProxyType` covariant
2021-07-30 17:05:15 +02:00
Anton Grübel
35cc7491db Add __defaults__ and __closure__ to types.MethodType (#5707) 2021-06-29 10:21:06 -07:00
Jelle Zijlstra
bfc83c365a Use PEP 604 in types.pyi (#5553) 2021-05-29 11:09:50 -07:00
Andrey
dbaaa3a103 PEP 604: Add ror operator and modify isinstance and subclass (#5509)
Add operators or and ror for types.Union and ror to the type class.
Also, add modified isinstance and issubclass signatures to support old-style and new-style unions inside.
2021-05-21 16:30:27 -07:00
Jelle Zijlstra
bce19fc206 make GeneratorType inherit from Generator (#5474)
Fixes #5496
2021-05-18 13:31:14 -07:00
Akuli
e66b7fa660 delete _importlib_modulespec (#5350)
* delete _importlib_modulespec

* use typing_extensions.runtime_checkable
2021-05-06 17:13:35 +03:00
hatal175
c9d996fe55 Various stubtest exceptions (#5227) 2021-04-17 07:03:28 -07:00
Andrey
31d1c30606 PEP 604: Add or operator to class type (#5151)
Co-authored-by: andrey.matveev <andrey.matveev@jetbrains.com>
2021-04-08 07:45:31 -07:00
Shantanu
38a1c344c9 Small fixes for Python 3.10 (#5044)
This is enough to get stubtest working (note that it's a little annoying
to install mypy currently since typed-ast seems to have broken again on
Python 3.10)

Co-authored-by: hauntsaninja <>
2021-02-20 18:44:36 -08:00
Ivan Levkivskyi
16ae4c6120 Re-organize directory structure (#4971)
See discussion in #2491

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
2021-01-27 12:00:39 +00:00