Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | gh-112328: Make EnumDict usable on its own and document it (GH-123669) | Petr Viktorin | 2024-12-20 | 1 | -1/+32 |
| | | | | | Co-authored-by: Rafi <rafi.promit@gmail.com> Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> Co-authored-by: Ethan Furman <ethan@stoneleaf.us> | ||||
* | gh-125259: Fix error notes removal in enum initialization (GH-125647) | Mario Šaško | 2024-10-22 | 1 | -0/+19 |
| | |||||
* | gh-125710: [Enum] fix hashable<->nonhashable comparisons for member values ↵ | Ethan Furman | 2024-10-22 | 1 | -0/+7 |
| | | | | (GH-125735) | ||||
* | Fix typos (#123775) | algonell | 2024-09-09 | 1 | -1/+1 |
| | |||||
* | gh-120361: Add `nonmember` test with enum flags inside to `test_enum` ↵ | Nikita Sobolev | 2024-06-14 | 1 | -0/+21 |
| | | | | | (GH-120364) * gh-120361: Add `nonmember` test with enum flags inside to `test_enum` | ||||
* | gh-117663: [Enum] fix _simple_enum's detection of aliases (GH-117664) | Ethan Furman | 2024-04-09 | 1 | -1/+51 |
| | |||||
* | gh-116600: [Enum] fix global Flag repr (GH-116615) | Ethan Furman | 2024-03-11 | 1 | -0/+2 |
| | | | | | | | * and fix global flag repr * Update Misc/NEWS.d/next/Library/2024-03-11-12-11-10.gh-issue-116600.FcNBy_.rst Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru> | ||||
* | gh-116040: [Enum] fix test_empty_names test (GH-116508) | Ethan Furman | 2024-03-11 | 1 | -11/+7 |
| | | | * and fix _not_given usage | ||||
* | gh-116040: [Enum] fix by-value calls when second value is falsey; e.g. ↵ | Ethan Furman | 2024-03-07 | 1 | -0/+23 |
| | | | | Cardinal(1, 0) (GH-116072) | ||||
* | gh-115821: [Enum] better error message for calling super().__new__() (GH-116063) | Ethan Furman | 2024-02-28 | 1 | -1/+12 |
| | | | | docs now state to not call super().__new__ if super().__new__ is called, a better error message is now used | ||||
* | gh-115539: Allow enum.Flag to have None members (GH-115636) | Jason Zhang | 2024-02-19 | 1 | -0/+16 |
| | |||||
* | gh-115252: Fix test_enum with -OO mode again (GH-115334) | Serhiy Storchaka | 2024-02-13 | 1 | -5/+5 |
| | |||||
* | gh-97959: Fix rendering of routines in pydoc (GH-113941) | Serhiy Storchaka | 2024-02-11 | 1 | -5/+5 |
| | | | | | | | | | | * Class methods no longer have "method of builtins.type instance" note. * Corresponding notes are now added for class and unbound methods. * Method and function aliases now have references to the module or the class where the origin was defined if it differs from the current. * Bound methods are now listed in the static methods section. * Methods of builtin classes are now supported as well as methods of Python classes. | ||||
* | gh-115252: Fix `test_enum` with `-OO` mode (GH-115253) | Nikita Sobolev | 2024-02-10 | 1 | -3/+14 |
| | |||||
* | gh-114071: [Enum] update docs and code for tuples/subclasses (GH-114871) | Ethan Furman | 2024-02-04 | 1 | -0/+34 |
| | | | | | | | | | | | | | | | | | | | | | | | Update documentation with `__new__` and `__init__` entries. Support use of `auto()` in tuple subclasses on member assignment lines. Previously, auto() was only supported on the member definition line either solo or as part of a tuple: RED = auto() BLUE = auto(), 'azul' However, since Python itself supports using tuple subclasses where tuples are expected, e.g.: from collections import namedtuple T = namedtuple('T', 'first second third') def test(one, two, three): print(one, two, three) test(*T(4, 5, 6)) # 4 5 6 it made sense to also support tuple subclasses in enum definitions. | ||||
* | gh-114149: [Enum] revert #114160 and add more tuple-subclass tests (GH-114215) | Ethan Furman | 2024-01-18 | 1 | -6/+21 |
| | | | This reverts commit 05e142b1543eb9662d6cc33722e7e16250c9219f. | ||||
* | gh-114149: [Enum] fix tuple subclass handling when using custom __new__ ↵ | Ethan Furman | 2024-01-17 | 1 | -0/+16 |
| | | | | (GH-114160) | ||||
* | gh-112328: [Enum] Make some private attributes public. (GH-112514) | Ethan Furman | 2023-12-05 | 1 | -2/+84 |
| | | | | | | | | | | | | | * [Enum] Make some private attributes public. - ``_EnumDict`` --> ``EnumDict`` - ``EnumDict._member_names`` --> ``EnumDict.member_names`` - ``Enum._add_alias_`` - ``Enum._add_value_alias_`` --------- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Nikita Sobolev <mail@sobolevn.me> | ||||
* | gh-111181: Fix enum doctests (GH-111180) | Nikita Sobolev | 2023-10-30 | 1 | -6/+11 |
| | | | Co-authored-by: Ethan Furman <ethan@stoneleaf.us> | ||||
* | gh-110905: [Enum] minor fixes and cleanup (GH-110906) | Pieter Eendebak | 2023-10-16 | 1 | -1/+1 |
| | |||||
* | gh-109022: [Enum] require `names=()` to create empty enum type (GH-109048) | Ethan Furman | 2023-09-08 | 1 | -4/+7 |
| | | | | | | | add guard so that ``Enum('bar')`` raises a TypeError instead of creating a new enum class called `bar`. To create the new but empty class, use: huh = Enum('bar', names=()) | ||||
* | gh-108840: Remove unused `TestEnumTypeSubclassing` from `test_enum` (#108841) | Nikita Sobolev | 2023-09-05 | 1 | -2/+0 |
| | |||||
* | gh-108682: [Enum] raise TypeError if super().__new__ called in custom ↵ | Ethan Furman | 2023-08-31 | 1 | -55/+229 |
| | | | | | | | | | | | __new__ (GH-108704) When overriding the `__new__` method of an enum, the underlying data type should be created directly; i.e. . member = object.__new__(cls) member = int.__new__(cls, value) member = str.__new__(cls, value) Calling `super().__new__()` finds the lookup version of `Enum.__new__`, and will now raise an exception when detected. | ||||
* | gh-108494: Argument Clinic: fix support of Limited C API (GH-108536) | Serhiy Storchaka | 2023-08-28 | 1 | -2/+4 |
| | |||||
* | 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 |
| |