On Thursday, June 27, 2013 11:56:24 AM UTC-4, Irmen de Jong wrote:
> 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 whe
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 t
On 06/27/2013 09:37 AM, Tim wrote:
On Thursday, June 27, 2013 9:16:50 AM UTC-4, Joshua Landau wrote:
On 26 June 2013 14:09, Tim wrote:
I am extending a parser and need to create many classes that are all subclassed
from the same object (defined in an external library). When my module is
loa
On Thursday, June 27, 2013 9:16:50 AM UTC-4, Joshua Landau wrote:
> On 26 June 2013 14:09, Tim wrote:
>
> > I am extending a parser and need to create many classes that are all
> > subclassed from the same object (defined in an external library). When my
> > module is loaded I need all the clas
On 26 June 2013 14:09, Tim wrote:
> I am extending a parser and need to create many classes that are all
> subclassed from the same object (defined in an external library). When my
> module is loaded I need all the classes to be created with a particular name
> but the behavior is all the same
On 26 Jun 2013 14:14, "Tim" wrote:
>
> I am extending a parser and need to create many classes that are all
subclassed from the same object (defined in an external library). When my
module is loaded I need all the classes to be created with a particular
name but the behavior is all the same. Curr
On 26 June 2013 16:40, Peter Otten <__pete...@web.de> wrote:
> Joshua Landau wrote:
>
>> I would say if a dict isn't good, there are still some cases where you
>> might not want to use globals.
>>
>> I _might_ do:
>
>> # Make a module
>> module_for_little_classes = ModuleType("module_for_little_cla
Joshua Landau wrote:
> I would say if a dict isn't good, there are still some cases where you
> might not want to use globals.
>
> I _might_ do:
> # Make a module
> module_for_little_classes = ModuleType("module_for_little_classes",
> "All the things")
> module_for_little_classes.__dict__.update
On 26 June 2013 15:46, Peter Otten <__pete...@web.de> wrote:
> The clean way to
> cope with the situation is to use a dict:
>
> classnames = ["Vspace", ...]
> classes = {name: type(name, ...) for name in classnames}
>
> Then you can access the Vspace class with
>
> classes["Vspace"]
>
> If that is
On Wednesday, June 26, 2013 10:46:55 AM UTC-4, Peter Otten wrote:
> Tim wrote:
> > I am not completely understanding the type function I guess. Here is an
> > example from the interpreter:
>
> No, you are not understanding how Python namespaces work ;)
> To get a Vspace in the global namespace yo
Tim wrote:
> I am not completely understanding the type function I guess. Here is an
> example from the interpreter:
>
> In [1]: class MyClass(object):
>...: pass
>...:
> In [2]: type('Vspace', (MyClass,), {})
> Out[2]: __main__.Vspace
> In [3]: x = Vspace()
>
---
On Wednesday, June 26, 2013 9:39:12 AM UTC-4, Peter Otten wrote:
> Tim wrote:
> > I am extending a parser and need to create many classes that are all
> > subclassed from the same object (defined in an external library). When my
> > module is loaded I need all the classes to be created with a pa
Tim wrote:
> I am extending a parser and need to create many classes that are all
> subclassed from the same object (defined in an external library). When my
> module is loaded I need all the classes to be created with a particular
> name but the behavior is all the same. Currently I have a bunch
I am extending a parser and need to create many classes that are all subclassed
from the same object (defined in an external library). When my module is
loaded I need all the classes to be created with a particular name but the
behavior is all the same. Currently I have a bunch of lines like th
14 matches
Mail list logo