You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2012-01-24.20:14:47.253>labels= ['type-feature', 'library']
title='Add qualname support to types.FunctionType'updated_at=<Date2019-03-16.00:11:55.835>user='https://github.com/meadori'
As mentioned in bpo-13672 currently there is no way to specify a
qualname on types.FunctionType:
>>> deff():
... defg():
... pass
... return g
...
>>> g = f()
>>> g
<function f.<locals>.g at 0x7f1dac4d8ba0>
>>> types.FunctionType(f.__code__, {})
<function f at 0x7f1dac4dfae0>
>>> types.FunctionType(g.__code__, {})
If bpo-13672 is fixed, then the qualname can be derived from the passed
in code object like name is. We can also add an optional parameter to
the FunctionType constructor for qualname.
I am working on a patch relative to the one I just posted for bpo-13672.
>>> import types
>>> types.FunctionType(f.__code__, {})
<function f at 0x1073aad00>
>>> types.FunctionType(g.__code__, {})
<function f.<locals>.g at 0x1073aadb0>
>>> g
<function f.<locals>.g at 0x1073aaba0>
>>>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: