Message210104
Python 3.4.0b3+ (default:19d81cc213d7, Feb 1 2014, 10:38:23)
[GCC 4.8.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> def test(a,b,c=None): pass
>>> set(dir(test)) - set(dir(len))
{'__get__', '__code__', '__globals__', '__dict__', '__defaults__', '__kwdefaults__', '__annotations__', '__closure__'}
>>> test.__kwdefaults__
>>> test.__defaults__
(None,)
>>> test.__annotations__
{}
>>> test.__code__
<code object test at ..., file "<stdin>", line 1>
>>> dir(test.__code__)
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'co_argcount', 'co_cellvars', 'co_code', 'co_consts', 'co_filename', 'co_firstlineno', 'co_flags', 'co_freevars', 'co_kwonlyargcount', 'co_lnotab', 'co_name', 'co_names', 'co_nlocals', 'co_stacksize', 'co_varnames']
>>> test.__code__.co_varnames
()
>>> test.__code__.co_varnames
()
>>> test.__code__.co_varnames
('a', 'b', 'c')
>>> test.__code__.co_kwonlyargcount
0
>>> test.__code__.co_name
'test'
But again, this is not covered by the subject of this ticket. I also don't think it's a good idea to delay Py3.4 until this discrepancy is fixed. |
|
Date |
User |
Action |
Args |
2014-02-03 10:05:31 | scoder | set | recipients:
+ scoder, terry.reedy, ncoghlan, pitrou, larry, benjamin.peterson, eric.araujo, python-dev, yselivanov |
2014-02-03 10:05:31 | scoder | set | messageid: <1391421931.58.0.650187165813.issue17159@psf.upfronthosting.co.za> |
2014-02-03 10:05:31 | scoder | link | issue17159 messages |
2014-02-03 10:05:31 | scoder | create | |
|