Commit Graph

21 Commits

Author SHA1 Message Date
Sebastian Rittau
a6e369906d max() uses SupportsGreaterThanT (#6342)
Add SupportsGreaterThan and SupportsGreaterThanT

Closes: #6336

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-11-21 13:28:46 +01:00
Akuli
994b69ef8f Use lowercase tuple where possible (#6170) 2021-10-14 17:18:19 -07:00
Vincent Pelletier
4c0dccac0f Fold remaining custom stdlib *Buffer types into _typeshed. (#6082)
Add ctypes base type to WriteableBuffer.
Add a ReadOnlyBuffer type from fcntl.
Base ReadableBuffer on WriteableBuffer and ReadOnlyBuffer.
Use these types in fcntl and ctypes stubs.
2021-09-28 09:15:26 +02:00
Sebastian Rittau
b562d233ae (a)next only requires __(a)next__, not Iterator (#6036) 2021-09-14 11:43:21 +03:00
Bas van Beek
d599a535b2 Allow math.trunc to only accept __trunc__-supporting objects (#6003)
Add SupportsTrunc protocol
2021-09-04 18:16:53 +02:00
Akuli
ce11072dbe Big diff: use lower-case list and dict (#5888) 2021-08-08 09:26:35 -07:00
Akuli
ee487304d7 Big diff: Use new "|" union syntax (#5872) 2021-08-08 11:05:21 +02:00
Bas van Beek
7c37d6117d Allow reversed to take any object implementing __len__ and __getitem__ (#5820)
`reversed` is currently annotated as accepting either a `Sequence` or objects implementing the `__reversed__` protocol.
This however is too strict as, per its [docs](https://docs.python.org/3/library/functions.html#reversed), it can take any object that implements `__len__` and `__getitem__`.
2021-07-29 07:48:14 -07:00
Sebastian Rittau
816a92b8e8 Add Self type var to _typeshed (#5677)
Cf. #5676
2021-06-22 22:15:27 +02:00
Sebastian Rittau
87e805bce6 Remove AnyPath (#5592)
Part of #5470
2021-06-09 00:25:01 +02:00
Akuli
200260e685 move DndSource to tkinter/dnd.pyi (#5588) 2021-06-07 07:07:57 -07:00
Sebastian Rittau
21e647a184 Document _typeshed (#5501)
* Document _typeshed

Closes: #5486

* Allow README.md files
2021-05-19 22:15:21 +03:00
Sebastian Rittau
f0bf6eebbd AnyStr cleanup (#5487)
* Replace all uses of StrPath, BytesPath, and AnyPath in Python 2 stubs.
* Add StrOrBytesPath as preferred alias for AnyPath.
* Replace all remaining AnyPath instances with StrOrBytesPath.
* Mark AnyPath as obsolete.

Part of #5470
2021-05-17 20:45:48 +02:00
Sebastian Rittau
7a9a107a63 Move IdentityFunction to _typeshed (#5483)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-05-17 12:04:35 +02:00
Sebastian Rittau
6a9c89e928 Replace 'Text' with 'str' in py3 stdlib (#5466) 2021-05-16 07:10:48 -07:00
Akuli
17dcea4a68 Akuli and srittau: Remove Python 2 branches from Python 3 stubs (#5461)
* run script and do some manual changes (Akuli)

* do the whole thing manually (srittau)

* merge changes (Akuli)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2021-05-15 15:33:39 +03:00
Sebastian Rittau
4ac3ccad45 black: enable skip_magic_trailing_comma (#5252)
* black: enable skip_magic_trailing_comma

* Remove spurious commas
2021-04-27 08:32:32 -07:00
Sebastian Rittau
4d734e38dd Add docutils definitions and (incomplete) modules (#5192) 2021-04-16 11:50:23 -07:00
Eric Traut
0ec182227c Added a few missing type arguments for generic types used in stdlib stubs
I just found and fixed a bug in pyright's "missing type arguments" check. When type arguments were omitted for a generic type within a subscript expression, the error was being suppressed. With this bug fixed, I found several new cases where type arguments were missing in stdlib stubs. (#5130)

Co-authored-by: Eric Traut <erictr@microsoft.com>
2021-03-22 18:28:04 -07:00
Eric Traut
29c3d67626 Improved definition of divmod function in builtins (#5114)
Co-authored-by: Eric Traut <erictr@microsoft.com>
2021-03-15 11:10:09 +01: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