None in string => TypeError?
Chris Angelico
rosuav at gmail.com
Mon Jun 9 14:02:51 EDT 2014
More information about the Python-list mailing list
Mon Jun 9 14:02:51 EDT 2014
- Previous message (by thread): None in string => TypeError?
- Next message (by thread): None in string => TypeError?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, Jun 10, 2014 at 3:58 AM, Ian Kelly <ian.g.kelly at gmail.com> wrote: > On Mon, Jun 9, 2014 at 11:40 AM, Chris Angelico <rosuav at gmail.com> wrote: >> Also, this is the first time I've seen None as a constant other than >> the first. Usually co_consts[0] is None, but this time co_consts[4] is >> None. > > Functions always seem to have None as the first constant, but modules > and classes are other examples that don't. > >>>> co = compile("class MyClass: pass", '', 'exec') >>>> co.co_consts > (<code object MyClass at 0x7f32aa0a3c00, file "", line 1>, 'MyClass', None) >>>> co.co_consts[0].co_consts > ('MyClass', None) Huh. Learn something every day! ChrisA
- Previous message (by thread): None in string => TypeError?
- Next message (by thread): None in string => TypeError?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list