Skip to content

Commit d5eca22

Browse files
committed
Fix documentation due to an enum attribute lookup bug in Cython 3.1.0.
1 parent b2dd107 commit d5eca22

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGES.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Other changes
120120
* Named ``cpdef enums`` no longer copy their item names into the global module namespace.
121121
This was considered unhelpful for named enums which already live in their own class namespace.
122122
In cases where the old behaviour was desired, users can add the following backwards compatible
123-
command after their enum class definition: ``globals().update(TheUserEnumClass.__members__)``.
123+
command after their enum class definition: ``globals().update(getattr(TheUserEnumClass, '__members__'))``.
124124
Anonymous enums still produce global item names, as before.
125125
(Github issue :issue:`4571`)
126126

docs/src/userguide/language_basics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ their own value, which makes it backwards compatible.
283283

284284
::
285285

286-
globals().update(CheeseState.__members__)
286+
globals().update(getattr(CheeseState, '__members__'))
287287

288288
There is currently no special syntax for defining a constant, but you can use
289289
an anonymous :keyword:`enum` declaration for this purpose, for example,::

0 commit comments

Comments
 (0)