Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | gh-105522: [Enum] Correctly handle possible exceptions during testing ↵ | Nikita Sobolev | 2023-08-16 | 1 | -54/+96 |
| | | | | (GH-105523) | ||||
* | gh-106602: [Enum] Add __copy__ and __deepcopy__ (GH-106666) | Prince Roshan | 2023-07-12 | 1 | -0/+8 |
| | |||||
* | gh-105497: [Enum] Fix flag mask inversion when unnamed flags exist (#106468) | Ethan Furman | 2023-07-11 | 1 | -55/+83 |
| | | | | | | | | | | | For example: class Flag(enum.Flag): A = 0x01 B = 0x02 MASK = 0xff ~Flag.MASK is Flag(0) | ||||
* | gh-105497: [Enum] Fix Flag inversion when alias/mask members exist. (GH-105542) | Ethan Furman | 2023-06-09 | 1 | -0/+39 |
| | | | 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 | -1/+27 |
| | | | | | * 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 | -9/+9 |
| | |||||
* | gh-104764: Skip failing tests in test_enum that started failing. (#104765) | T. Wouters | 2023-05-22 | 1 | -7/+7 |
| | | | Skip failing tests in test_enum that started failing when the version was bumped to 3.13. | ||||
* | gh-103596: [Enum] do not shadow mixed-in methods/attributes (GH-103600) | Ethan Furman | 2023-04-18 | 1 | -0/+17 |
| | | | | | | | | | | | | | | | | | | 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 | -6/+7 |
| | | | 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 | -8/+39 |
| | | | | | | STRICT boundary: - fix bitwise operations - make default for Flag | ||||
* | gh-93910: [Enum] remove member.member deprecation (GH-103236) | Ethan Furman | 2023-04-06 | 1 | -21/+8 |
| | | | | i.e. Color.RED.BLUE is now officially supported. | ||||
* | gh-102549: [Enum] fail enum creation when data type raises in __init__ ↵ | Ethan Furman | 2023-03-31 | 1 | -0/+20 |
| | | | | (GH-103149) | ||||
* | gh-102558: [Enum] better handling of non-Enum EnumType classes (GH-103060) | Ethan Furman | 2023-03-27 | 1 | -1/+0 |
| | |||||
* | gh-103056: [Enum] ensure final _generate_next_value_ is a staticmethod ↵ | Ethan Furman | 2023-03-27 | 1 | -0/+17 |
| | | | | (GH-103062) | ||||
* | gh-102558: [Enum] fix AttributeError during member repr() (GH-102601) | Dong-hee Na | 2023-03-23 | 1 | -1/+8 |
| | |||||
* | Rename redundant enum tests so that they run (#102535) | JosephSBoyle | 2023-03-14 | 1 | -3/+2 |
| | |||||
* | gh-102515: Remove unused imports in the `Lib/` directory (#102516) | Alex Waygood | 2023-03-08 | 1 | -2/+0 |
| | |||||
* | gh-101541: [Enum] create flag psuedo-member without calling original __new__ ↵ | Ethan Furman | 2023-02-06 | 1 | -0/+40 |
| | | | | (GH-101590) | ||||
* | gh-100039: enhance __signature__ to work with str and callables (GH-100168) | Ethan Furman | 2022-12-16 | 1 | -2/+23 |
| | | | | | 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 | -0/+13 |
| | | | | | | 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. | ||||
* | [Enum] Remove unused code from `test_enum.py` (GH-96986) | Nikita Sobolev | 2022-12-07 | 1 | -14/+0 |
| | |||||
* | gh-94943: [Enum] improve repr() when inheriting from a dataclass (GH-99740) | Ethan Furman | 2022-12-06 | 1 | -3/+53 |
| | | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> | ||||
* | gh-99518: Fix escape symbol in `test_enum` (#99519) | Nikita Sobolev | 2022-11-16 | 1 | -1/+1 |
| | |||||
* | gh-92647: [Enum] use final status to determine lookup or create (GH-99500) | Ethan Furman | 2022-11-15 | 1 | -3/+18 |
| | | | | | | | * 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> | ||||
* | gh-99248: [Enum] fix negative number infinite loop (GH-99256) | Ethan Furman | 2022-11-08 | 1 | -1/+15 |
| | | | | | | | | [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 | ||||
* | [Enum] add built-in property to test_test_simple_enum (GH-98453) | Ethan Furman | 2022-11-06 | 1 | -0/+6 |
| | |||||
* | gh-93464: [Enum] fix auto() failure during multiple assignment (GH-99148) | Ethan Furman | 2022-11-06 | 1 | -0/+44 |
| | | | | | | * 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 |
| | |||||
* | gh-95591: [Enum] use `_FlagTests` base class (GH-96475) | Nikita Sobolev | 2022-09-20 | 1 | -4/+4 |
| | |||||
* | gh-95077: [Enum] add code-based deprecation warnings for member.member ↵ | Ethan Furman | 2022-07-25 | 1 | -1/+15 |
| | | | | | | | 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 | -6/+1 |
| | | | | | 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 | -1/+6 |
| | | | | boost (GH-94913) | ||||
* | gh-93910: Fix enum performance regression (GH-94614) | Michael Droettboom | 2022-07-07 | 1 | -0/+1 |
| | | | | | | | | | | | | | | 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-94318: Strip trailing spaces in pydoc text output (GH-94319) | Serhiy Storchaka | 2022-06-27 | 1 | -27/+27 |
| | |||||
* | gh-93820: Pickle enum.Flag by name (GH-93891) | Serhiy Storchaka | 2022-06-26 | 1 | -2/+42 |
| | |||||
* | [Enum] Remove automatic docstring generation (GH-94188) | Sam Ezeh | 2022-06-23 | 1 | -162/+4 |
| | |||||
* | gh-91456: [Enum] Deprecate default auto() behavior with mixed value types ↵ | Oscar R | 2022-06-23 | 1 | -9/+56 |
| | | | | | | | (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 | -94/+69 |
| | | | 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 | -0/+10 |
| | |||||
* | gh-93820: Fix copy() regression in enum.Flag (GH-93876) | Christian Heimes | 2022-06-16 | 1 | -0/+28 |
| | | | | | | | | 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 | -2/+10 |
| | | | | | (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. | ||||
* | gh93107: [Enum] fix missing variable in global_str (GH-93107) | Ethan Furman | 2022-05-23 | 1 | -0/+11 |
| | |||||
* | Update CPyhton configuration for 3.12 (#92451) | Dong-hee Na | 2022-05-08 | 1 | -0/+6 |
| | | | | | | | * Update CPyhton configuration for 3.12 * Fix PC/pyconfig.h * Add expect failure | ||||
* | gh-78157: [Enum] nested classes will not be members in 3.13 (GH-92366) | Ethan Furman | 2022-05-06 | 1 | -0/+141 |
| | | | | | | | - add member() and nonmember() functions - add deprecation warning for internal classes in enums not becoming members in 3.13 Co-authored-by: edwardcwang | ||||
* | bpo-40280: Detect missing threading on WASM platforms (GH-32352) | Christian Heimes | 2022-04-07 | 1 | -0/+2 |
| | | | Co-authored-by: Brett Cannon <brett@python.org> | ||||
* | bpo-46198: rename duplicate tests and remove unused code (GH-30297) | Nikita Sobolev | 2022-03-10 | 1 | -1/+1 |
| | |||||
* | bpo-46477: [Enum] ensure Flag subclasses have correct bitwise methods (GH-30816) | Ethan Furman | 2022-01-23 | 1 | -0/+7 |
| | |||||
* | bpo-45535: [Enum] include special dunders in dir() (GH-30677) | Ethan Furman | 2022-01-18 | 1 | -24/+29 |
| | | | | | | | | | Include the `__dunders__` in `dir()` that make `Enum` special: - `__contains__` - `__getitem__` - `__iter__` - `__len__` - `__members__` | ||||
* | bpo-46418: [Enum] simplify `MODULE` declaration in tests (GH-30647) | Nikita Sobolev | 2022-01-17 | 1 | -1/+1 |
| |