On Thu, Nov 10, 2011 at 10:01 AM, Devin Jeanpierre <jeanpierr...@gmail.com> wrote: >> If it were someone other than Raymond Hettinger responsible for the use >> of exec in namedtuple, I'd be a lot more suspicious of it. > > I'm not going to be less suspicious based on a name. It reads like > insanity, and the justification was terrible.
It's said that code exists foremost for humans to read, and only incidentally for computers to execute. I believe that this is inverted for library code; as long as the _interface_ is clean, you can get away with some messy internals, because it's going to be executed far more often than actually read. Python programmers can use namedtuples happily without knowing that the implementation uses exec. The justification is, if I understand correctly, that the alternative is worse. That's plenty of justification imho. ChrisA -- http://mail.python.org/mailman/listinfo/python-list