Feature request: subclassing FunctionType [Was: Some language proposals]

Josiah Carlson jcarlson at nospam.uci.edu
Tue Mar 2 02:32:20 EST 2004


> 1. Assuming all "for" loops and list comprehensions are replaced
>    with Haskell bindings rules, what about backward compatibility
>    problems? For instance: is there enough code relying on the loop 
>    variable being available outside the loop?

Having a variable available outside of a loop can be both a convenience 
and inconvenience, depending on the situation.  I have used it before, 
but acknowledge that it is poor form.


> 2. If, due to compatibility issues, it is not possible to change the
>    binding rules of existing loops, would it make sense to propose
>    these binding rules for Python 2.4 generator comprehension?
>    This would not be backward incompatible, but would it generate
>    confusion?

 From what I can gather from the python-dev mailing list, generator 
expressions seem to work the same as list comprehensions, without the 
list.  If I am incorrect, feel free to correct me.


> 3. Assuming the rules can be changed without real trouble, is the feature
>    worth enough? Do people care about it, and is there somebody willing
>    to take the job? 

Changing the rules can cause real trouble.  If loop variables were an 
unintended consequence, were not desireable by a large portion of Python 
users, and were used rarely, if at all, then I believe it is likely that 
would have been removed already.

  - Josiah



More information about the Python-list mailing list