Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | gh-105497: [Enum] Fix Flag inversion when alias/mask members exist. (GH-105542) | Ethan Furman | 2023-06-09 | 1 | -8/+7 |
| | | | When inverting a Flag member (or boundary STRICT), only consider other canonical flags; when inverting an IntFlag member (or boundary KEEP), also consider aliases. | ||||
* | gh-105332: [Enum] Fix unpickling flags in edge-cases (GH-105348) | Nikita Sobolev | 2023-06-08 | 1 | -21/+9 |
| | | | | | * revert enum pickling from by-name to by-value Co-authored-by: Ethan Furman <ethan@stoneleaf.us> | ||||
* | gh-104764: [Enum] fix 3.13-specific tests (GH-104779) | Ethan Furman | 2023-05-23 | 1 | -34/+10 |
| | |||||
* | gh-103596: [Enum] do not shadow mixed-in methods/attributes (GH-103600) | Ethan Furman | 2023-04-18 | 1 | -35/+51 |
| | | | | | | | | | | | | | | | | | | For example: class Book(StrEnum): title = auto() author = auto() desc = auto() Book.author.desc is Book.desc but Book.author.title() == 'Author' is commonly expected. Using upper-case member names avoids this confusion and possible performance impacts. Co-authored-by: samypr100 <3933065+samypr100@users.noreply.github.com> | ||||
* | gh-103479: [Enum] require __new__ to be considered a data type (GH-103495) | Ethan Furman | 2023-04-13 | 1 | -1/+2 |
| | | | a mixin must either have a __new__ method, or be a dataclass, to be interpreted as a data-type | ||||
* | gh-103365: [Enum] STRICT boundary corrections (GH-103494) | Ethan Furman | 2023-04-13 | 1 | -28/+39 |
| | | | | | | STRICT boundary: - fix bitwise operations - make default for Flag | ||||
* | [Enum] unchain exception property.__get__ (GH-103305) | Ethan Furman | 2023-04-06 | 1 | -1/+1 |
| | |||||
* | gh-93910: [Enum] remove member.member deprecation (GH-103236) | Ethan Furman | 2023-04-06 | 1 | -25/+25 |
| | | | | i.e. Color.RED.BLUE is now officially supported. | ||||
* | gh-103056: [Enum] use staticmethod decorator for _gnv_ (GH-103231) | Ethan Furman | 2023-04-04 | 1 | -0/+3 |
| | | | _gnv_ --> _generate_next_value_ | ||||
* | gh-98298, gh-74730: [Enum] update docs (GH-103163) | Ethan Furman | 2023-04-03 | 1 | -4/+4 |
| | | | | fix FlagBoundary statements add warning about reloading modules and enum identity | ||||
* | gh-103215: Remove redundant if stmt from `enum.EnumType._find_data_type_` ↵ | Sadra Barikbin | 2023-04-03 | 1 | -2/+0 |
| | | | | (GH-103222) | ||||
* | gh-102549: [Enum] fail enum creation when data type raises in __init__ ↵ | Ethan Furman | 2023-03-31 | 1 | -14/+11 |
| | | | | (GH-103149) | ||||
* | gh-102558: [Enum] better handling of non-Enum EnumType classes (GH-103060) | Ethan Furman | 2023-03-27 | 1 | -7/+5 |
| | |||||
* | gh-103056: [Enum] ensure final _generate_next_value_ is a staticmethod ↵ | Ethan Furman | 2023-03-27 | 1 | -0/+5 |
| | | | | (GH-103062) | ||||
* | gh-102558: [Enum] fix AttributeError during member repr() (GH-102601) | Dong-hee Na | 2023-03-23 | 1 | -0/+2 |
| | |||||
* | gh-101541: [Enum] create flag psuedo-member without calling original __new__ ↵ | Ethan Furman | 2023-02-06 | 1 | -3/+2 |
| | | | | (GH-101590) | ||||
* | gh-101341: Remove unncessary enum._power_of_two function (gh-101342) | Dong-hee Na | 2023-01-28 | 1 | -5/+0 |
| | |||||
* | gh-86682: Adds sys._getframemodulename as an alternative to using _getframe ↵ | Steve Dower | 2023-01-13 | 1 | -5/+7 |
| | | | | | (GH-99520) Also updates calls in collections, doctest, enum, and typing modules to use _getframemodulename first when available. | ||||
* | gh-100039: enhance __signature__ to work with str and callables (GH-100168) | Ethan Furman | 2022-12-16 | 1 | -1/+8 |
| | | | | | Callables should be either class- or static-methods. Enum now uses the classmethod version to greatly improve the help given for enums and flags. | ||||
* | gh-100098: [Enum] insist on actual tuples, no subclasses, for auto (GH-100099) | Ethan Furman | 2022-12-08 | 1 | -1/+3 |
| | | | | | | When checking for auto() instances, only top-level usage is supported, which means either alone or as part of a regular tuple. Other containers, such as lists, dicts, or namedtuples, will not have auto() transformed into a value. | ||||
* | gh-92120: The docstring of enum.Enum is invalid in reST (GH-92122) | Takeshi KOMIYA | 2022-12-08 | 1 | -7/+7 |
| | | | Closes #92120 | ||||
* | gh-94943: [Enum] improve repr() when inheriting from a dataclass (GH-99740) | Ethan Furman | 2022-12-06 | 1 | -1/+17 |
| | | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> | ||||
* | gh-92647: [Enum] use final status to determine lookup or create (GH-99500) | Ethan Furman | 2022-11-15 | 1 | -4/+9 |
| | | | | | | | * use final status to determine lookup or create * 📜🤖 Added by blurb_it. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> | ||||
* | [Enum] update version TODO comment (GH-99458) | Ethan Furman | 2022-11-14 | 1 | -1/+1 |
| | |||||
* | gh-99248: [Enum] fix negative number infinite loop (GH-99256) | Ethan Furman | 2022-11-08 | 1 | -1/+7 |
| | | | | | | | | [Enum] fix negative number infinite loop - _iter_bits_lsb() now raises a ValueError if a negative number is passed in - verify() now skips checking negative numbers for named flags | ||||
* | gh-93464: [Enum] fix auto() failure during multiple assignment (GH-99148) | Ethan Furman | 2022-11-06 | 1 | -8/+25 |
| | | | | | | * fix auto() failure during multiple assignment i.e. `ONE = auto(), 'text'` will now have `ONE' with the value of `(1, 'text')`. Before it would have been `(<an auto instance>, 'text')` | ||||
* | gh-96865: [Enum] fix Flag to use CONFORM boundary (GH-97528) | Ethan Furman | 2022-10-05 | 1 | -1/+1 |
| | |||||
* | [Enum] fix typos (GH-96285) | wim glenn | 2022-09-20 | 1 | -2/+2 |
| | |||||
* | gh-95149: Enhance `http.HTTPStatus` with properties that indicate the HTTP ↵ | Alexandru Mărășteanu | 2022-08-30 | 1 | -1/+1 |
| | | | | status category (GH-95453) | ||||
* | gh-95077: [Enum] add code-based deprecation warnings for member.member ↵ | Ethan Furman | 2022-07-25 | 1 | -45/+41 |
| | | | | | | | access (GH-95083) * issue deprecation warning for member.member access * always store member property in current class * remove __getattr__ | ||||
* | Revert "gh-93910: [Enum] restore member.member restriction while keeping ↵ | Ethan Furman | 2022-07-18 | 1 | -8/+0 |
| | | | | | performance boost (GH-94913)" (#94985) This reverts commit c20186c3972ff38577c4c5e32ca86748210983d2. | ||||
* | gh-94601: [Enum] fix inheritance for __str__ and friends (GH-94942) | Ethan Furman | 2022-07-18 | 1 | -5/+21 |
| | |||||
* | gh-93910: [Enum] restore member.member restriction while keeping performance ↵ | Ethan Furman | 2022-07-17 | 1 | -0/+8 |
| | | | | boost (GH-94913) | ||||
* | gh-93910: Fix enum performance regression (GH-94614) | Michael Droettboom | 2022-07-07 | 1 | -8/+9 |
| | | | | | | | | | | | | | | This removes the performance regression in 3.11, **at the expense of not fixing the "bug" that allows accessing values from values** (e.g. `Color.RED.BLUE`). Using the benchmark @markshannon [presented](https://github.com/python/cpython/issues/93910#issuecomment-1165503032), the results are: | Version | Enum | Fast enum | Normal class | | --- | --- | --- | --- | | 3.10 | 2.04 | 0.59 | 0.56 | | 3.11 | 2.78 | 0.31 | 0.15 | | This PR | 1.30 | 0.32 | 0.16 | I share this mostly as information about the source of the regression, as this may be useful. It may be that the lower-risk approach for the beta is just to revert to a previously-known working state. | ||||
* | gh-93820: Pickle enum.Flag by name (GH-93891) | Serhiy Storchaka | 2022-06-26 | 1 | -1/+15 |
| | |||||
* | [Enum] Remove automatic docstring generation (GH-94188) | Sam Ezeh | 2022-06-23 | 1 | -105/+0 |
| | |||||
* | [Enum] fix typo (GH-94158) | Ethan Furman | 2022-06-23 | 1 | -8/+8 |
| | |||||
* | gh-91456: [Enum] Deprecate default auto() behavior with mixed value types ↵ | Oscar R | 2022-06-23 | 1 | -8/+26 |
| | | | | | | | (GH-91457) When used with plain Enum, auto() returns the last numeric value assigned, skipping any incompatible member values (such as strings); starting in 3.13 the default auto() for plain Enums will require all the values to be of compatible types, and will return a new value that is 1 higher than any existing value. Co-authored-by: Ethan Furman <ethan@stoneleaf.us> | ||||
* | gh-88123: Implement new Enum __contains__ (GH-93298) | Carl Bordum Hansen | 2022-06-22 | 1 | -18/+8 |
| | | | Co-authored-by: Ethan Furman <ethan@stoneleaf.us> | ||||
* | gh-93847: Fix repr of enum of generic aliases (GH-93885) | Serhiy Storchaka | 2022-06-16 | 1 | -2/+2 |
| | |||||
* | gh-93820: Fix copy() regression in enum.Flag (GH-93876) | Christian Heimes | 2022-06-16 | 1 | -0/+3 |
| | | | | | | | | GH-26658 introduced a regression in copy / pickle protocol for combined `enum.Flag`s. `copy.copy(re.A | re.I)` would fail with `AttributeError: ASCII|IGNORECASE`. `enum.Flag` now has a `__reduce_ex__()` method that reduces flags by combined value, not by combined name. | ||||
* | gh-93250: [Enum] Change IntEnum boundary to KEEP for backwards compatibility ↵ | Ethan Furman | 2022-05-27 | 1 | -1/+1 |
| | | | | | (GH-93302) In previous versions of Python if an IntEnum member was combined with another integer type value using a bit-wise operation, the resulting value would still be the IntEnum type. This change restores that behavior. | ||||
* | gh-93035: [Enum] Fix IntFlag crash when no single-bit members (GH-93076) | Tobin Yehle | 2022-05-25 | 1 | -1/+1 |
| | | | `EnumType` attempts to create a custom docstring for each enum/flag, but that was failing with pathological flags that had no members (only multi-bit aliases). | ||||
* | gh-93118: [Enum] fix error message (GH-93138) | Ethan Furman | 2022-05-23 | 1 | -2/+3 |
| | | | Include member names in error message. | ||||
* | gh93107: [Enum] fix missing variable in global_str (GH-93107) | Ethan Furman | 2022-05-23 | 1 | -0/+1 |
| | |||||
* | [Enum] Remove redundant check for existing members. (GH-92590) | Ethan Furman | 2022-05-10 | 1 | -3/+0 |
| | |||||
* | gh-78157: [Enum] nested classes will not be members in 3.13 (GH-92366) | Ethan Furman | 2022-05-06 | 1 | -4/+53 |
| | | | | | | | - add member() and nonmember() functions - add deprecation warning for internal classes in enums not becoming members in 3.13 Co-authored-by: edwardcwang | ||||
* | bpo-46477: [Enum] ensure Flag subclasses have correct bitwise methods (GH-30816) | Ethan Furman | 2022-01-23 | 1 | -39/+41 |
| | |||||
* | bpo-45535: [Enum] include special dunders in dir() (GH-30677) | Ethan Furman | 2022-01-18 | 1 | -20/+13 |
| | | | | | | | | | Include the `__dunders__` in `dir()` that make `Enum` special: - `__contains__` - `__getitem__` - `__iter__` - `__len__` - `__members__` | ||||
* | bpo-40066: [Enum] skip failing doc test (GH-30637) | Kumar Aditya | 2022-01-17 | 1 | -232/+371 |
| |