Python vs C for a mail server

Paul Boddie paul at boddie.org.uk
Sun Jan 29 17:28:12 EST 2006


Jay Parlar wrote:
> I don't think I've ever seen anyone advocating calling a function like
> getattr(obj "foo" + "bar")().

>From Lib/compiler/visitor.py:

meth = getattr(self.visitor, 'visit' + className, 0)

Later on:

meth(node, *args)

Of course, you can drop the "visit" prefix and make the mechanism more
predictable, but a search on the standard library for getattr produces
a lot of evidence against your assertion.

Paul




More information about the Python-list mailing list