Re: [Python-Dev] Why co_names? Wouldn't be simpler to just use co_consts?

2015-01-29 Thread Nick Coghlan
On 29 January 2015 at 04:53, Andrea Griffini wrote: > The names stored in op_names are totally unrelated as they can be attribute > names, module names, global names; you basically don't know much about them > unless you also inspect the actual bytecode using them (and the same name > can be used

Re: [Python-Dev] Why co_names? Wouldn't be simpler to just use co_consts?

2015-01-28 Thread Andrea Griffini
The names stored in op_names are totally unrelated as they can be attribute names, module names, global names; you basically don't know much about them unless you also inspect the actual bytecode using them (and the same name can be used in completely different ways in different parts of the same c

Re: [Python-Dev] Why co_names? Wouldn't be simpler to just use co_consts?

2015-01-28 Thread Nick Coghlan
On 28 January 2015 at 21:21, Greg Ewing wrote: > Andrea Griffini wrote: >> >> Sorry if the question is naive, but why is co_names needed? Wouldn't be >> simpler to just use co_consts? > > One reason might be that keeping them separate means > you can have up to 256 names and 256 consts using > 1-b

Re: [Python-Dev] Why co_names? Wouldn't be simpler to just use co_consts?

2015-01-28 Thread Greg Ewing
Andrea Griffini wrote: Sorry if the question is naive, but why is co_names needed? Wouldn't be simpler to just use co_consts? One reason might be that keeping them separate means you can have up to 256 names and 256 consts using 1-byte opcode arguments. Otherwise, you'd be limited to a total of

[Python-Dev] Why co_names? Wouldn't be simpler to just use co_consts?

2015-01-28 Thread Andrea Griffini
Sorry if the question is naive, but why is co_names needed? Wouldn't be simpler to just use co_consts? Andrea ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mail