Re: Closures in metaclasses

2011-02-18 Thread zambr123
Hi there, We are currently looking for someone who has ideally several years coding experience, and who is familar with Network coding and the Python language. The project revolves around emulation and a chat based system, altough the vast majority of the project is focused on the chat based

Re: Closures in metaclasses

2010-01-21 Thread Arnaud Delobelle
Falcolas writes: > On Jan 21, 12:10 pm, Arnaud Delobelle wrote: [...] >> Or you could override __getattr__ >> >> -- >> Arnaud > > I tried overriding __getattr__ and got an error at runtime (the > instance did not have xyz key, etc), and the Tag dict is not > modifiable (granted, I tried Tag.__di

Re: Closures in metaclasses

2010-01-21 Thread Falcolas
On Jan 21, 1:55 pm, Peter Otten <__pete...@web.de> wrote: > Falcolas wrote: > > I tried overriding __getattr__ and got an error at runtime (the > > You can either move __getattr__() into the metaclass or instantiate the > class. I prefer the latter. > > Both approaches in one example: > > >>> class

Re: Closures in metaclasses

2010-01-21 Thread Peter Otten
Falcolas wrote: > I tried overriding __getattr__ and got an error at runtime (the You can either move __getattr__() into the metaclass or instantiate the class. I prefer the latter. Both approaches in one example: >>> class Tag: ... class __metaclass__(type): ... def __getattr_

Re: Closures in metaclasses

2010-01-21 Thread Falcolas
On Jan 21, 12:10 pm, Arnaud Delobelle wrote: > On Jan 21, 6:37 pm, Falcolas wrote: > > > On Jan 21, 11:24 am, Arnaud Delobelle wrote: > > > It was the easiest way I found to add a lot of static methods to the > > Tag class without writing each one out. __getattr__ was not working > > for this ap

Re: Closures in metaclasses

2010-01-21 Thread Arnaud Delobelle
On Jan 21, 6:37 pm, Falcolas wrote: > On Jan 21, 11:24 am, Arnaud Delobelle wrote: > > > > > > > Falcolas writes: > > > I'm running into an issue with closures in metaclasses - that is, if I > > > create a function with a closure in a metaclass, the closure appears > > > to be lost when I access

Re: Closures in metaclasses

2010-01-21 Thread Falcolas
On Jan 21, 11:24 am, Arnaud Delobelle wrote: > Falcolas writes: > > I'm running into an issue with closures in metaclasses - that is, if I > > create a function with a closure in a metaclass, the closure appears > > to be lost when I access the final class. I end up getting the text > > 'param' i

Re: Closures in metaclasses

2010-01-21 Thread Arnaud Delobelle
Falcolas writes: > I'm running into an issue with closures in metaclasses - that is, if I > create a function with a closure in a metaclass, the closure appears > to be lost when I access the final class. I end up getting the text > 'param' instead of the actual tags I am expecting: > > ALL_TAGS