[Python-Dev] Decorators: vertical bar syntax (original) (raw)

Bill Janssen janssen at parc.com
Mon Aug 9 03:31:49 CEST 2004


In the discussion on decorators months ago, solutions involving special syntax inside the block were ruled out early on. Basically, you shouldn't have to peek inside the block to find out important external properties of the function.

Guido, could you expand on this principle a bit? Just stated as it is, it sounds as pointless (to my untutored mind, at least :-), as the arguments about "@ is ugly, so it shouldn't be used". After all, isn't "what the function does" an important external property of the function, and don't you have to peek inside the block to determine that? For instance, how do you know whether a function is a generator unless you look for yield statements inside it?

Bill



More information about the Python-Dev mailing list