@@ -1562,7 +1562,7 @@ def preamble_lookup(
15621562 doc
15631563 ), f'enumeration class { self .target !r} should have an explicit docstring'
15641564
1565- args = self ._preamble_args ()
1565+ args = self ._preamble_args (functional_constructor = False )
15661566 return self ._preamble (doc = doc , args = args , indent = indent , ** options )
15671567
15681568 def preamble_constructor (
@@ -1572,7 +1572,7 @@ def preamble_constructor(
15721572 doc
15731573 ), f'enumeration class { self .target !r} should have an explicit docstring'
15741574
1575- args = self ._preamble_args ()
1575+ args = self ._preamble_args (functional_constructor = True )
15761576 return self ._preamble (doc = doc , args = args , indent = indent , ** options )
15771577
15781578 def _preamble (
@@ -1582,12 +1582,25 @@ def _preamble(
15821582 return self ._node ('class' , self .name , doc , args = args , indent = indent , ** options )
15831583
15841584 @staticmethod
1585- def _preamble_args ():
1585+ def _preamble_args (functional_constructor : bool = False ):
15861586 """EnumType.__call__() is a dual-purpose method:
15871587
15881588 * Look an enum member (valid only if the enum has members)
15891589 * Create a new enum class (functional API)
15901590 """
1591+ if sys .version_info [:2 ] >= (3 , 13 ) or sys .version_info [:3 ] >= (3 , 12 , 3 ):
1592+ if functional_constructor :
1593+ return (
1594+ '(new_class_name, /, names, *, module=None, '
1595+ 'qualname=None, type=None, start=1, boundary=None)'
1596+ )
1597+ else :
1598+ return '(*values)'
1599+ if sys .version_info [:2 ] >= (3 , 12 ):
1600+ return (
1601+ '(value, names=None, *values, module=None, '
1602+ 'qualname=None, type=None, start=1, boundary=None)'
1603+ )
15911604 return '(value)'
15921605
15931606 def method (
0 commit comments