Re: Metaclass uses?

2006-12-18 Thread Bruno Desthuilliers
Nathan Harmston a écrit :
(snip)
> Also is there anymore interesting OO stuff that Python has apart from Java.

Quite a lot. Everything (well, except statements and expressions...) in 
Python is an object, including classes, modules and functions, and 
Python objects are really 'dynamic', ie you can modify them at runtime - 
and when I say 'modify', I mean things like adding/replacing/removing 
attributes, including methods and class (which are attributes too...).
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Metaclass uses?

2006-12-18 Thread Michele Simionato
Nathan Harmston wrote:
> Hi,
>
> Recently I posted a question about the factory pattern in python. I ve
> implemented this following one of the ideas posted. After some reading
> I ve seem a lot of Aspect Oriented Programming mentioned but I m not
> really sure what it is.
>
> Can anyone help me understand how metaclasses can improve the quality
> of my code and let me do better things.

Have you read the two papers in IBMDeveloperWorks about metaclasses?
There is also
a third one, about avoiding metaclasses, which is waiting for
publication. Here is the draft:
http://www.phyast.pitt.edu/~micheles/python/classinitializer.html

   Michele Simionato

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Metaclass uses?

2006-12-17 Thread Paddy

Nathan Harmston wrote:
> Also is there anymore interesting OO stuff that Python has apart from Java.
Duck Typing: http://www.thescripts.com/forum/thread22721.html;
http://mindview.net/WebLog/log-0025,
Python does not have checked exceptions:
http://www.mindview.net/Etc/Discussions/CheckedExceptions

- Paddy.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Metaclass uses?

2006-12-15 Thread Mike C. Fletcher
Nathan Harmston wrote:
> Hi,
>
> Recently I posted a question about the factory pattern in python. I ve
> implemented this following one of the ideas posted. After some reading
> I ve seem a lot of Aspect Oriented Programming mentioned but I m not
> really sure what it is.
>
> Can anyone help me understand how metaclasses can improve the quality
> of my code and let me do better things.
>   
My presentation from three pycons ago was an attempt to address this 
issue (what metaclasses are useful for):

http://www.vrplumber.com/programming/metaclasses-pycon.pdf

HTH,
Mike

-- 

  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://www.vrplumber.com
  http://blog.vrplumber.com

-- 
http://mail.python.org/mailman/listinfo/python-list


Metaclass uses?

2006-12-15 Thread Nathan Harmston
Hi,

Recently I posted a question about the factory pattern in python. I ve
implemented this following one of the ideas posted. After some reading
I ve seem a lot of Aspect Oriented Programming mentioned but I m not
really sure what it is.

Can anyone help me understand how metaclasses can improve the quality
of my code and let me do better things.

Also is there anymore interesting OO stuff that Python has apart from Java.

Many Thanks

Nathan
-- 
http://mail.python.org/mailman/listinfo/python-list