__init__ as a lambda

John Nagle nagle at animats.com
Wed Aug 4 19:28:29 EDT 2010


On 8/4/2010 12:58 PM, Eric J. Van der Velden wrote:
> Hello,
>
> Suppose
>
> class C:
>   def __init__(self,name):self.name=name
>
> I was wondering if I could make the __init__ a lambda

     Python is not a functional language.  Attempts to make
it one make it worse.

     There's this mindset that loops are somehow "bad".
This leads to list comprehensions, multiline lambdas, more
elaborate generators, weird conditional expression
syntax, and related cruft.  Most of these features are of
marginal, if not negative, value.

    Unfortunately, some of them have gone into Python.

				John Nagle



More information about the Python-list mailing list