Allow using enum elements as default values for Python functions.
Enum values are just (integer) constants in Python and so can be used as the function default values just as well as literal numbers, account for this when checking whether function parameters can be represented in Python. Also rename is_primitive_defaultargs() to is_representable_as_pyargs() to describe better what this function does.
This commit is contained in:
parent
8734c658d7
commit
52bd2a1921
2 changed files with 35 additions and 31 deletions
|
|
@ -1,5 +1,8 @@
|
|||
import default_args
|
||||
|
||||
ec = default_args.EnumClass()
|
||||
if not ec.blah():
|
||||
raise RuntimeError,"EnumClass::blah() default arguments don't work"
|
||||
|
||||
if default_args.Statics_staticMethod() != 60:
|
||||
raise RuntimeError
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue