class factory question
Irmen de Jong
irmen.NOSPAM at xs4all.nl
Thu Jun 27 11:56:24 EDT 2013
On 27-6-2013 15:48, Dave Angel wrote:
>> The behavior for these is all the same so they're subclassed
>> from one base class, but they need to have these particular names so the parser knows
>> how to consume them when encountered in the source file. That is, for every custom
>> command the parser encounters, it looks for a class of that name in order to tokenize it.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
How does it look for a class?
Can you perhaps override the way it looks for a class of that name?
So that you can instead return something sensible rather than having to define one of 50
almost identical classes...
Irmen
More information about the Python-list
mailing list