(original) (raw)
To top off today's set of hopeful thread closures I want to put this one to rest.
While I'm not ready to accept PEP 563 yet (I'm waiting for the first cut of the implementation) I \*am\* hereby nixing the thunk idea.When I said I was more worried about that than about the stringification that wasn't about compatibility so much as about conceptual simplicity. Right now the contents of \_\_annotations\_\_ can be one of two things: an object created by evaluating an annotation, or a string literal. With stringification these two possibilities remain the only two possibilities (and they will still both occur in files that don't use the \_\_future\_\_ import). With thunks, there would be a third option, a 0-argument callable.
I've always disliked APIs (like Django templates, IIRC) that "transparently" support callables by calling them and treat all other values as-is. (What if I have a value that just \*happens\* to be callable?) I don't want to add such an API.
I also don't like the idea that there's nothing you can do with a thunk besides calling it -- you can't meaningfully introspect it (not without building your own bytecode interpreter anyway).
Nick, please don't try to save the thunk proposal by carefully dissecting every one of my objections. That will just prolong its demise.
--
--Guido van Rossum (python.org/\~guido)