Commit Graph

22 Commits

Author SHA1 Message Date
Alex Waygood
4e046163b5 Delete many redundant method redefinitions (#6877) 2022-01-09 11:21:03 -08:00
Alex Waygood
a40d79a4e6 Use lowercase type everywhere (#6853) 2022-01-08 16:09:29 +01:00
Alex Waygood
8d5d2520ac Use PEP 585 syntax wherever possible (#6717) 2021-12-28 11:31:43 +01:00
Alex Waygood
a7c9788948 Improve stub for enum.property (#6648) 2021-12-21 21:11:07 -08:00
Alex Waygood
519d70097b Update enum.pyi (#6629) 2021-12-20 17:51:48 -08:00
Alex Waygood
f3026dc3ab Improve enum.StrEnum (#6580)
A `StrEnum` can only have strings as values.
2021-12-13 17:59:31 +01:00
Alex Waygood
cc054efa79 Make name and value read-only for Enums, part II (#6578) 2021-12-13 17:00:28 +01:00
Alex Waygood
0f2e87e42a Make name and value read-only for Enums (#6576) 2021-12-13 16:08:49 +01:00
Alex Waygood
c3cd88ba91 Add EnumMeta.__new__ & EnumMeta.__call__ (#6572) 2021-12-13 12:33:54 +01:00
Nikita Sobolev
b1f0271da6 Add EnumType to enum.pyi on Python 3.11 (#6568) 2021-12-11 19:13:32 +02:00
Akuli
a5bc1e037f Add mypy error codes to '# type: ignore' comments (#6379) 2021-11-26 07:07:56 +01:00
Jake Bailey
b9ea346c14 Use overrides for IntFlag dunder-r methods (#6114) 2021-10-04 18:00:36 -07:00
Bas van Beek
b9e1d7d522 Replace Mapping with types.MappingProxyType (#6013)
Mark `Signature.parameters` and `.return_annotation` as read-only properties
2021-09-09 09:58:53 +02:00
Anthony Sottile
f1e367851c Fix types of enum _member_names, etc. (#5986)
Move fields onto EnumMeta
2021-09-02 11:46:57 +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
Sebastian Rittau
acc576659a Use Python 3.10 beta 4 instead of beta 1 in CI (#5839)
Quote all Python versions to make sure they are interpreted as strings,
not floats.
2021-08-02 07:30:32 -07:00
Maarten ter Huurne
0d9521970d Mark enum.Flag.name as Optional[str] (#5611)
* Mark enum.Flag.name as Optional[str]

* Annotate enum.Flag.value
2021-06-16 19:25:47 +03:00
Shantanu
4a45b1d1b4 enum: update for py310 (#5314)
I remember there are some subtleties around Enum.__new__, that might be
relevant to StrEnum, but I'm forgetting the details.

I wasn't sure how best to handle the new enum.property. I could also
re-export, or take a more literal interpretation.

Co-authored-by: hauntsaninja <>
2021-05-04 15:12:19 +03:00
Maxime Arthaud
3536e2a080 Type the constructor of IntEnum and IntFlag (#5217)
These should only accept integers or enum members.
2021-04-14 18:41:07 -07:00
Eric Traut
e2967a8bee Eliminated the use of "bare" TypeVars in stdlib stubs (#5041)
Eliminated the use of "bare" TypeVars (i.e. a TypeVar that appears only once) within generic methods. While not considered an error in PEP 484, these are a common source of bugs in code, and some type checkers (including pytype and pyright) flag them as errors.

Co-authored-by: Eric Traut <erictr@microsoft.com>
2021-02-27 19:43:45 -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