Shantanu
6ff5b88ca7
typeshed: remove crufty comments ( #4699 )
...
Co-authored-by: hauntsaninja <>
2020-10-23 09:40:06 +02: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
Milap Sheth
66a9a4b5ce
Fix type hint of generator throw method ( #4253 )
...
* Fix type hint of generator throw method
* Incorporated changes from #4252
2020-06-21 15:23:28 -07:00
Sebastian Rittau
c32e1e2280
Enable --disallow-any-generics for stubs ( #3288 )
2019-10-01 05:31:34 -07:00
Rebecca Chen
d64a26cf99
Add missing constructor to types.CodeType. ( #3040 )
...
I got the argument order from
2bfc2dc214/Objects/codeobject.c (L263)
and the types from the attributes already in the stub.
2019-06-08 07:07:29 -07:00
Jelle Zijlstra
b5493e8639
add types.FunctionType.__init__ ( #2968 )
...
Fixes #2930
2019-05-07 17:31:01 +02:00
Michael Lee
efb67946f8
Use variable annotations everywhere ( #2909 )
2019-04-13 10:40:52 +02:00
Brandt Bucher
1857435e6f
types.CodeType.co_filename isn't Optional. ( #2639 )
2018-11-27 20:53:05 -08:00
Jelle Zijlstra
63cf7f529b
fix lint error ( #2541 )
2018-10-23 14:00:26 +02:00
Semyon Proshev
4859742087
Inherit InstanceType from object ( #2511 )
2018-10-08 14:31:21 +02:00
Michael J. Sullivan
65863bebf4
make __class__ refer to the current object's class ( #2480 )
...
This is just a direct rehash of #1549 .
2018-09-25 18:04:37 -07:00
Yusuke Miyazaki
6192cce9d9
Avoid using string literals in type annotations ( #2294 )
2018-07-02 20:23:29 -07:00
Jelle Zijlstra
78587dc895
Revert "make __class__ refer to the current object's class ( #1549 )" ( #1632 )
...
This reverts commit 1a164b630c .
Reverts python/typeshed#1549 .
See Guido's comments in the original PR.
2017-09-29 11:37:54 -07:00
Jelle Zijlstra
1a164b630c
make __class__ refer to the current object's class ( #1549 )
...
Fixes python/mypy#3061
2017-09-27 18:11:59 -07:00
Semyon Proshev
72fbc459a7
Add __init__ to types.MethodType ( #1499 )
2017-07-26 08:38:27 -07:00
Roy Williams
ac87de50dd
Add __name__ field to MethodType ( #1442 )
...
See 08c16016e2/Lib/types.py (L32-L34)
```python
>>> class _C:
... def _m(self): pass
...
>>> _C()._m.__name__
'_m'
```
2017-06-29 10:05:25 -07:00
Guido van Rossum
359c8cc313
Remove all mention of 'module' from typeshed. ( #1156 )
...
This depends on python/mypy#3107 .
2017-04-13 08:40:52 -07:00
rchen152
51959f09c7
Change types.pyi syntax that pytype can't parse. ( #1157 )
...
* Fix a few return types in stdlib/2/inspect.pyi.
* Rename _FrameRecord to _FrameInfo
* Correct some return types in itertools.pyi from Iterable to Iterator.
* Change types.pyi syntax that pytype can't parse.
2017-04-12 16:11:03 -07:00
Guido van Rossum
72d275bbf5
Don't reference long in types.pyi ( #1112 )
...
(It's a type alias for int anyway, and it will cause a problem in the
initial import cycle once #886 is merged.)
2017-03-29 10:43:44 -07:00
Jelle Zijlstra
349ff59f33
change empty bodies from "pass" to "..."
...
CONTRIBUTING.md says to prefer ... Not the most impactful change but fixing
these will allow us to lint for it in the future and get a consistent style.
2017-03-16 09:13:08 -07:00
David Euresti
dbea48fc7a
Make 2nd argument to ModuleType an optional kwarg ( #941 )
2017-02-20 11:10:59 -08:00
Andrey Vlasovskikh
2d46679da8
Added attributes present in inheritors of types.InstanceType ( #885 )
2017-01-29 11:26:30 -08:00
Lukasz Langa
d70bb0c00f
Fixing flake8 E202, E203, E225 errors
2016-12-20 01:02:59 -08:00
Lukasz Langa
fe0e3744cc
Fixing flake8 E261 errors
2016-12-19 22:09:35 -08:00
TrueBrain
15ec66cdd6
Consider __doc__ always Optional. ( #641 )
...
python/mypy#2380 showed a discrepancy between object and FunctionType in stdlib2. The first defined __doc__ to be str, the second Optional[str]. As FunctionType depends on object, this is no longer valid.
As suggested by @gvanrossum in python/mypy#2380 , all __doc__ should be considered Optional.
(Final verdict was just to remove most __doc__ attributes since it's inherited from object.)
2016-10-30 11:48:23 -07:00
Guido van Rossum
cb97bb54c0
Move 2.7 to 2 ( #635 )
...
Closes #579 .
2016-10-26 16:24:49 -07:00