Re: Metaclass mystery

2009-06-01 Thread LittleGrasshopper
On Jun 1, 12:18 am, Lie Ryan lie.1...@gmail.com wrote: LittleGrasshopper wrote: On May 31, 2:03 pm, a...@pythoncraft.com (Aahz) wrote: In article eaf75582-0d22-4b31-b0e7-b8e5baa5c...@s21g2000vbb.googlegroups..com, LittleGrasshopper  seattleha...@yahoo.com wrote: On May 31, 12:19=A0am

Re: Metaclass mystery

2009-06-01 Thread LittleGrasshopper
On Jun 1, 12:42 am, Michele Simionato michele.simion...@gmail.com wrote: On May 31, 2:32 am, LittleGrasshopper seattleha...@yahoo.com wrote: Seriously, metaclasses are making my brain hurt. How do people like Michele Simionato and David Mertz figure these things out? Does it all come

Re: Metaclass mystery

2009-06-01 Thread LittleGrasshopper
On Jun 1, 11:11 am, Michele Simionato michele.simion...@gmail.com wrote: On Jun 1, 7:18 pm, LittleGrasshopper seattleha...@yahoo.com wrote: I have to thank you for all the invaluable materials you have provided to the python community. The process that you followed must have been

Re: Simple metaclass code failing

2009-06-01 Thread LittleGrasshopper
On Jun 1, 2:38 am, Piet van Oostrum p...@cs.uu.nl wrote: LittleGrasshopper seattleha...@yahoo.com (L) wrote: L On May 31, 3:59 pm, Carl Banks pavlovevide...@gmail.com wrote: On May 31, 3:52 pm, LittleGrasshopper seattleha...@yahoo.com wrote: This is some simple code which I got from

Re: Simple metaclass code failing

2009-06-01 Thread LittleGrasshopper
On Jun 1, 3:44 am, Piet van Oostrum p...@cs.uu.nl wrote: Piet van Oostrum p...@cs.uu.nl (I) wrote: I But your class definition: I class C3(C1, C2): I says that C1 should be before C2. Conflict!! I Change it to class C3(C2, C1): Of course the C1 is then superfluous. I wonder why you want

Re: Metaclass mystery

2009-05-31 Thread LittleGrasshopper
On May 31, 9:24 am, LittleGrasshopper seattleha...@yahoo.com wrote: On May 31, 12:19 am, Arnaud Delobelle arno...@googlemail.com wrote: LittleGrasshopper seattleha...@yahoo.com writes: On May 30, 6:15 pm, Carl Banks pavlovevide...@gmail.com wrote: On May 30, 5:32 pm, LittleGrasshopper

Re: Metaclass mystery

2009-05-31 Thread LittleGrasshopper
On May 31, 2:03 pm, a...@pythoncraft.com (Aahz) wrote: In article eaf75582-0d22-4b31-b0e7-b8e5baa5c...@s21g2000vbb.googlegroups.com, LittleGrasshopper  seattleha...@yahoo.com wrote: On May 31, 12:19=A0am, Arnaud Delobelle arno...@googlemail.com wrote: [1]http://www.python.org/download

Simple metaclass code failing

2009-05-31 Thread LittleGrasshopper
This is some simple code which I got from Guido's paper on the unification of classes and types, which Arnaud suggested to improve my knowledge of metaclasses: class M1(type): pass class M2(M1): pass class M3(M2): pass class C1: __metaclass__ = M1 class C2(C1): __metaclass__ =

Re: Simple metaclass code failing

2009-05-31 Thread LittleGrasshopper
On May 31, 3:52 pm, LittleGrasshopper seattleha...@yahoo.com wrote: This is some simple code which I got from Guido's paper on the unification of classes and types, which Arnaud suggested to improve my knowledge of metaclasses: class M1(type):     pass class M2(M1):     pass class M3(M2

Re: Simple metaclass code failing

2009-05-31 Thread LittleGrasshopper
On May 31, 3:59 pm, Carl Banks pavlovevide...@gmail.com wrote: On May 31, 3:52 pm, LittleGrasshopper seattleha...@yahoo.com wrote: This is some simple code which I got from Guido's paper on the unification of classes and types, which Arnaud suggested to improve my knowledge

Re: Simple metaclass code failing

2009-05-31 Thread LittleGrasshopper
On May 31, 4:11 pm, LittleGrasshopper seattleha...@yahoo.com wrote: On May 31, 3:59 pm, Carl Banks pavlovevide...@gmail.com wrote: On May 31, 3:52 pm, LittleGrasshopper seattleha...@yahoo.com wrote: This is some simple code which I got from Guido's paper on the unification of classes

Metaclass mystery

2009-05-30 Thread LittleGrasshopper
I am experimenting with metaclasses, trying to figure out how things are put together. At the moment I am baffled by the output of the following code: Output is: instance of metaclass MyMeta being created (class '__main__.MyMeta', class '__main__.MyMeta')

Re: Metaclass mystery

2009-05-30 Thread LittleGrasshopper
On May 30, 4:01 pm, LittleGrasshopper seattleha...@yahoo.com wrote: I am experimenting with metaclasses, trying to figure out how things are put together. At the moment I am baffled by the output of the following code: Output is: instance of metaclass

Re: How can 'type' be an instance of itself?

2009-05-29 Thread LittleGrasshopper
On May 28, 11:07 pm, Terry Reedy tjre...@udel.edu wrote: LittleGrasshopper wrote: On May 28, 4:37 pm, Christian Heimes li...@cheimes.de wrote: LittleGrasshopper wrote: This is probably trivial, but it's driving me mad somehow. All (new style) classes are instances of 'type' by default

How can 'type' be an instance of itself?

2009-05-28 Thread LittleGrasshopper
This is probably trivial, but it's driving me mad somehow. All (new style) classes are instances of 'type' by default, unless a custom metaclass is specified. I take this to mean that when a class declaration is found in the code, an instance of 'type' representing that class is created by calling

Re: How can 'type' be an instance of itself?

2009-05-28 Thread LittleGrasshopper
On May 28, 4:37 pm, Christian Heimes li...@cheimes.de wrote: LittleGrasshopper wrote: This is probably trivial, but it's driving me mad somehow. All (new style) classes are instances of 'type' by default, unless a custom metaclass is specified. I take this to mean that when a class

Re: How can 'type' be an instance of itself?

2009-05-28 Thread LittleGrasshopper
On May 28, 4:37 pm, Christian Heimes li...@cheimes.de wrote: LittleGrasshopper wrote: This is probably trivial, but it's driving me mad somehow. All (new style) classes are instances of 'type' by default, unless a custom metaclass is specified. I take this to mean that when a class

Re: from __future__ import absolute_import issue

2009-05-25 Thread LittleGrasshopper
On May 23, 6:39 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Sat, 23 May 2009 12:32:24 -0300, LittleGrasshopper   seattleha...@yahoo.com escribió: On May 22, 12:42 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Wed, 20 May 2009 20:18:02 -0300, LittleGrasshopper

What text editor is everyone using for Python

2009-05-25 Thread LittleGrasshopper
With so many choices, I was wondering what editor is the one you prefer when coding Python, and why. I normally use vi, and just got into Python, so I am looking for suitable syntax files for it, and extra utilities. I dabbled with emacs at some point, but couldn't get through the key bindings for

Re: What text editor is everyone using for Python

2009-05-25 Thread LittleGrasshopper
On May 25, 10:44 am, J Kenneth King ja...@agentultra.com wrote: LittleGrasshopper seattleha...@yahoo.com writes: With so many choices, I was wondering what editor is the one you prefer when coding Python, and why. I normally use vi, and just got into Python, so I am looking for suitable

Re: from __future__ import absolute_import issue

2009-05-23 Thread LittleGrasshopper
On May 22, 12:42 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Wed, 20 May 2009 20:18:02 -0300, LittleGrasshopper   seattleha...@yahoo.com escribió: New to the group, this is my first post... It appears that either absolute imports (or my brain) aren't working. Given a module

from __future__ import absolute_import issue

2009-05-20 Thread LittleGrasshopper
New to the group, this is my first post... It appears that either absolute imports (or my brain) aren't working. Given a module string.py which is in the same directory as a.py: #File a.py from __future__ import absolute_import import string print string # Module imported is string.py in

Re: from __future__ import absolute_import issue

2009-05-20 Thread LittleGrasshopper
On May 20, 4:18 pm, LittleGrasshopper seattleha...@yahoo.com wrote: New to the group, this is my first post... It appears that either absolute imports (or my brain) aren't working. Given a module string.py which is in the same directory as a.py: #File a.py from __future__ import