A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-June/054188.html below:

[Python-Dev] Multiple expression eval in compound if statement?

[Python-Dev] Multiple expression eval in compound if statement? [Python-Dev] Multiple expression eval in compound if statement?Anthony Baxter anthony at interlink.com.au
Mon Jun 13 16:16:00 CEST 2005
On Monday 13 June 2005 21:14, Skip Montanaro wrote:
>     Raymond> I think it unwise to allow x to be any expression.
>
> How do you decide what's "too complex"?  Even an apparently simple variable
> can have side effects, so the semantic change bit is important no matter
> how complex the expression.  (Consider the builtin help object.  Type it at
> the prompt with no parens.)

Note also that saying 'just a simple local variable' doesn't cut it, either, 
because you will break on something like:

class stupid:
    v = 0
    def __eq__(self, other):
        self.v += 1
        return self.v == other

Really, you'd have to make sure you didn't optimise any LHS that defined
a comparision operator (I _think_ that covers all the cases).

Anthony
-- 
Anthony Baxter     <anthony at interlink.com.au>
It's never too late to have a happy childhood.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4