python for loop

Carl Banks pavlovevidence at gmail.com
Thu Apr 2 04:02:16 EDT 2009


On Apr 1, 11:28 pm, Hrvoje Niksic <hnik... at xemacs.org> wrote:
> Carl Banks <pavlovevide... at gmail.com> writes:
> > This is unforgiveable, not only changing the indexing semantics of
> > Python (because a user would have NO CLUE that something underlying
> > has been changed, and thus it should never be done), but also for
> > the needless abuse of exec.
>
> Then I guess you'd fire Guido, too -- from socket.py:
>
> class _socketobject(object):
>     [...]
>     _s = ("def %s(self, *args): return self._sock.%s(*args)\n\n"
>           "%s.__doc__ = _realsocket.%s.__doc__\n")
>     for _m in _socketmethods:
>         exec _s % (_m, _m, _m, _m)
>     del _m, _s

Damn straight I would, recklessly using exec like he owns the language
or something.


Carl Bansk



More information about the Python-list mailing list