> 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
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
Hello,
I've just wanted to check Python's abilities as a calculator and this
is what came out:
>>> 1.0 + 3.0 + 4.6
8.5996
Ehm, how could I get the intuitively 'correct' result of - say - 8.6?
;-)
best regards
Steffen
--
http://mail.python.org/mailman/listinfo/python-list
> 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
--
http://mail.python.org/mai
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
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
--
http://mail.python.org/mailman/listinfo/python-l
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 response
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] = wrapper(