Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #9268

Re: Property setter and lambda question

Date 2011-07-11 13:26 -0400
From John Posner <jjposner@codicesoftware.com>
Subject Re: Property setter and lambda question
References <CAAyd8cncdj0CStxZdWDcpWCjjEd7WVA=m-CQ0H988zuv52SwMg@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.911.1310405216.1164.python-list@python.org> (permalink)

Show all headers | View raw


On 2:59 PM, Anthony Kong wrote:

<snip>
> So the question: is it possible to use lambda expression at all for
> the setter? (As in the last, commented-out line)
>
> Python interpreter will throw an exception right there if I use the
> last line ('SyntaxError: lambda cannot contain assignment'). I'd use
> pass a setter method anyway.  
>
> What is your preferred solution?

Anthony, you might take a look at this alternative writeup for
"property", which I placed on the Python Wiki:

    http://wiki.python.org/moin/AlternativeDescriptionOfProperty

HTH,
John


Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Property setter and lambda question John Posner <jjposner@codicesoftware.com> - 2011-07-11 13:26 -0400

csiph-web