Guido sees the light: PEP 8 updated

Gregory Ewing greg.ewing at canterbury.ac.nz
Mon Apr 18 04:43:37 EDT 2016


Marko Rauhamaa wrote:
> Steven D'Aprano <steve at pearwood.info>:
> 
>>def Do_The_Thing():
>>    def internal_subpart_start(): ...
>>    def internal_subpart_middle(): ...
>>    def internal_subpart_end(): ...
>>    ...
> 
> That really should be done more. C weaned us from the routine Pascal
> mechanism, but there's no reason not to exploit it again in Python.

Two things Python has that Pascal didn't are modules
and classes. They take care of a lot of the grouping
that you had to rely on nested functions for in
Pascal.

I do find myself nesting functions like that in
Python, but only very occasionally.

-- 
Greg



More information about the Python-list mailing list