Re: Precision?

2005-05-16 Thread Steffen Glückselig
So for using the python-interpreter as a simple calculator using 'print' seems to be the simplest and still exact way... Thanks for clarification Steffen -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Polymorphism

2005-05-16 Thread Steffen Glückselig
Ah, that's not polymorphism; it's method overloading. And AFAIK it is not possible in Python. It IS polymorphism. Not the one one is usually referring to, but it is. Overloading is an 'ad hoc'-polymorphism. regards Steffen -- http://mail.python.org/mailman/listinfo/python-list

Re: Which IDE is recommended?

2005-05-02 Thread Steffen Glückselig
I'm a fan of PSPad. It's free, light weight, and works with everything. I want to second that. For small scripts PSPad is definitely very useful and comfortable. For larger scripts I'd consider something with code-completion. Maybe PyDev. best regards Steffen --

Re: Injecting code into a function

2005-04-25 Thread Steffen Glückselig
Perhalps metaclasses are of interest to you. You can decorate existing methods with additional behavior using metaclasses. A simple example can be found at http://soiland.no/software/logmeta I've gathered some more links under http://www.gungfu.de/facts/wiki/field.php?pagename=Main.MetaProgramming

Question on metaclasses

2005-04-24 Thread Steffen Glückselig
Hello, I've been experimenting with metaclasses a bit (even though I am quite a newbie to python) and stumpled over the following problem in my code: class Meta(type): def __init__(cls, name, bases, dct): for attr, value in dct.items(): if callable(value): dct[attr] =

Re: Question on metaclasses

2005-04-24 Thread Steffen Glückselig
Are wrap and get_directives somehow built-in? I couldn't find references to them. I've noticed, too, that using __new__ I can manipulate the dictionary resulting in the behavior I intented. I'd rather like to know: Why does it work in __new__ but not in __init__? And, stimulated by your

Re: Question on metaclasses

2005-04-24 Thread Steffen Glückselig
So dct is something like a template rather than the __dict__ of the actual class? I'd assume that changing the content of a dict would be possible even after it has been assigned to some object (here, a class). thanks and best regards Steffen --