Re: [Tutor] Descriptors and type declaration order

2011-07-14 Thread Steven D'Aprano
Knacktus wrote: Hi guys, I've got the following (not working) code: [...] The problem is that the descriptors are created when the module is evaluated. But at this time the class BaseItem is not known yet. Any ideas? Yes -- don't do that. What are you actually trying to accomplish? Embeddin

Re: [Tutor] Descriptors and type declaration order

2011-07-14 Thread Emile van Sebille
On 7/14/2011 2:44 AM Knacktus said... Hi guys, I've got the following (not working) code: class Attribute(object): def __init__(self, attribute_name, att_type_name): self._attribute_name = attribute_name try: self._attribute_type = globals()[att_type_name]

Re: [Tutor] Descriptors and type declaration order

2011-07-14 Thread Dave Angel
On 07/14/2011 05:44 AM, Knacktus wrote: Hi guys, I've got the following (not working) code: class Attribute(object): def __init__(self, attribute_name, att_type_name): self._attribute_name = attribute_name try: self._attribute_type = globals()[att_type_name]