Marko Rauhamaa wrote:
Steven D'Aprano <st...@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
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to