Duncan Booth wrote: > Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: [...] >> My refactoring, with the bare minimum use of exec necessary: >> >> https://code.activestate.com/recipes/578918-yet-another-namedtuple/ > > > This may be a silly question, but what would stop you moving the exec > inside the class?
I don't know. I haven't tried it. I didn't think of it at the time. I don't have any specific arguments either against or in favour of your suggestions, except to say that exec is sometimes tricky to get working unless you explicitly specify the namespace to operate in. -- Steven -- https://mail.python.org/mailman/listinfo/python-list