[Python-ideas] Statement local functions and classes (aka PEP 3150 is dead, say 'Hi!' to PEP 403)

Antoine Pitrou solipsis at pitrou.net
Thu Oct 13 15:41:45 CEST 2011


On Thu, 13 Oct 2011 22:06:00 +1000
Nick Coghlan <ncoghlan at gmail.com> wrote:
> Actually, here's an interesting example based on quickly firing up a
> worker thread:
> 
> postdef t = threading.Thread(target=def); t.start()
> def pointless():
>     """A pointless worker thread that does nothing except serve as an example"""
>     print("Starting")
>     time.sleep(3)
>     print("Ending")

I think the problem is still that the syntax isn't nice or obvious.
Until the syntax is nice and obvious, I don't think there's any point
adding it.
(by contrast, decorators *are* nice and obvious: writing "@classmethod"
before a method was tons better than the previous redundant idiom)

Regards

Antoine.





More information about the Python-ideas mailing list