Re: Unexpected Python Behavior

From: Fernando Perez (fperez528_at_yahoo.com)
Date: 10/05/04


Date: Mon, 04 Oct 2004 18:16:31 -0600

Andrew Dalke wrote:

> Fernando Perez wrote:
>> Sorry to pitch in late, and forgive me if this has already been discussed

>
> It was discussed. Here's Alex's comments
>
> ] def f(x):
> ] if x in f.cache: ...
> ] f.cache = []
> ]
> ] which among other things suffers from f.cache having to be
> ] used in spots that come lexically before it's defined; or
> ] a decorator equivalent:

Ah, thanks for the pointer. The thread seemed long and heated, so I skimmed it
lightly for fear of getting burned ;)

Somehow I've just gotten used enough to this that the
'use-before-lexical-definition' ugliness just doesn't bother me. But it's
probably a sign that I've grown into a long-term relationship with python:
I've learned to gloss over some of its defects as a price for all the good
things it gives me, and at this point I just ignore them without having to
work at it. I guess I'm officially married to the language :)

Best,

f



Relevant Pages

  • Python training in Cheminformatics
    ... Python training in Cheminformatics ... Andrew Dalke is offering a course in Python programming ...
    (comp.lang.python.announce)
  • Re: Python as replacement for PHP?
    ... I'd argue that a number of existing frameworks ... exact same pitch for Spyce. ... If Python is to have anything like PHP's ... official Python distribution and declare it to be under official ...
    (comp.lang.python)
  • Re: Palindrome
    ... Andrew Dalke wrote: ... > Ulrich Schramme: ... > A slightly easier to understand and slower version is ... software developer by profession but quite new to Python. ...
    (comp.lang.python)
  • Re: For review: PEP 343: Anonymous Block Redux and Generator Enhancements
    ... Andrew Dalke wrote: ... Nothing in Python ends at the end of the current block. ... know, PEP343 has nothing to do with order of deletion, which is still ... But that's what this PEP is all ...
    (comp.lang.python)
  • Re: pickle alternative
    ... Andrew Dalke wrote: ... I'm running Python 2.4. ... benchmarks on a friends machine, also in Python 2.4, and received the ...
    (comp.lang.python)