python for loop

Hrvoje Niksic hniksic at xemacs.org
Thu Apr 2 02:28:19 EDT 2009


Carl Banks <pavlovevidence 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



More information about the Python-list mailing list