mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Close #19156: add tests and fix for Enum helper edge cases. Patch from CliffM.
This commit is contained in:
parent
ab5a58d827
commit
648f860c22
2 changed files with 33 additions and 2 deletions
|
@ -17,14 +17,16 @@ def _is_dunder(name):
|
|||
"""Returns True if a __dunder__ name, False otherwise."""
|
||||
return (name[:2] == name[-2:] == '__' and
|
||||
name[2:3] != '_' and
|
||||
name[-3:-2] != '_')
|
||||
name[-3:-2] != '_' and
|
||||
len(name) > 4)
|
||||
|
||||
|
||||
def _is_sunder(name):
|
||||
"""Returns True if a _sunder_ name, False otherwise."""
|
||||
return (name[0] == name[-1] == '_' and
|
||||
name[1:2] != '_' and
|
||||
name[-2:-1] != '_')
|
||||
name[-2:-1] != '_' and
|
||||
len(name) > 2)
|
||||
|
||||
|
||||
def _make_class_unpicklable(cls):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue