Re: [Python-Dev] hasattr and properties

2005-12-07 Thread Calvin Spealman
On 12/7/05, Greg Ewing <[EMAIL PROTECTED]> wrote: > Thomas Lotze wrote: > > > Apparently, when applied to a class instance, hasattr calls getattr and > > decides that the attribute doesn't exist if the call raises any exception. > > - Wouldn't it make sense to only report a missing attribute if an

Re: [Python-Dev] Short-circuiting iterators

2005-12-07 Thread Raymond Hettinger
[Matthew F. Barnes] > The ability to remotely terminate a for-loop also struck me as somewhat > interesting: > > def estimate(item, iterable): > . . . > if good_enough: > iterable.stop() > return result > > for x in iterable: > . . . >

Re: [Python-Dev] Tracker anonymity

2005-12-07 Thread Greg Ewing
Nick Coghlan wrote: > If the submitter is anonymous, not only can we not follow up with any > questions, neither does the submitter get notified of status changes on their > tracker. Would not simply requesting an email address along with the report provide enough information for questioning an

Re: [Python-Dev] Short-circuiting iterators

2005-12-07 Thread Matthew F. Barnes
On Tue, 2005-12-06 at 19:58 -0500, Raymond Hettinger wrote: > Any real-world use cases or compelling contrived examples? > > ISTM, that the code calling it.stop() would already be in position to > break-out of the iteration directly or set a termination flag. Instead > of: > > it = itertools

Re: [Python-Dev] hasattr and properties

2005-12-07 Thread Guido van Rossum
On 12/7/05, Greg Ewing <[EMAIL PROTECTED]> wrote: > Maybe descriptors need a fourth slot for hasattr > customisation? > > The logic would then be > >if there is a descriptor for the attribute: > if the descriptor's hasattr slot is populated: >return the result of calling it >

Re: [Python-Dev] hasattr and properties

2005-12-07 Thread Greg Ewing
Thomas Lotze wrote: > Apparently, when applied to a class instance, hasattr calls getattr and > decides that the attribute doesn't exist if the call raises any exception. > - Wouldn't it make sense to only report a missing attribute if an > AttributeError is raised? That would be an improvement

Re: [Python-Dev] ast-objects branch created

2005-12-07 Thread Jeremy Hylton
On 12/7/05, Delaney, Timothy (Tim) <[EMAIL PROTECTED]> wrote: > "Martin v. Löwis" wrote: > > > Nick Coghlan wrote: > >> As Fredrik pointed out a while back, the PyObject approach doesn't > >> *have* to involve manual decref operations - PyObject's come with a > >> ready made arena structure, in the

Re: [Python-Dev] ast-objects branch created

2005-12-07 Thread Fredrik Lundh
"Delaney, Timothy (Tim)" wrote: > > Nick Coghlan wrote: > >> As Fredrik pointed out a while back, the PyObject approach doesn't > >> *have* to involve manual decref operations - PyObject's come with a > >> ready made arena structure, in the form of PyList. > > > > That doesn't really work: PyList_

Re: [Python-Dev] ast-objects branch created

2005-12-07 Thread Delaney, Timothy (Tim)
"Martin v. Löwis" wrote: > Nick Coghlan wrote: >> As Fredrik pointed out a while back, the PyObject approach doesn't >> *have* to involve manual decref operations - PyObject's come with a >> ready made arena structure, in the form of PyList. > > That doesn't really work: PyList_Append (which you

Re: [Python-Dev] Tracker anonymity

2005-12-07 Thread Tony Meyer
[Nick] >> Can we put a warning on the anonymous submission page pointing out >> the problems with using it for non-trivial bug reports? [Skip] > I don't think we have any control over the boilerplate SF displays. There must be some control. There's a "Outlook users please see the list of frequ

[Python-Dev] hasattr and properties

2005-12-07 Thread Thomas Lotze
Hi, I've noticed some behaviour of hasattr when used on properties which I'm inclined to call a bug, or at least unexpected behaviour: Python 2.4.2 (#1, Oct 29 2005, 13:11:33) [GCC 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)] on linux2 [...] >>> class Foo(object): ... def get(self): ...

Re: [Python-Dev] Tracker anonymity

2005-12-07 Thread Michael Hudson
[EMAIL PROTECTED] writes: > In c.l.py Paul Rubin wrote: > > Paul> In the old days, it was possible to post stuff to Python's > Paul> sourceforge pages without logging in. That was turned off for > Paul> various reasons that weren't bogus, but that didn't strike me as > Paul> overw

Re: [Python-Dev] Tracker anonymity

2005-12-07 Thread skip
Guido> Anyway, now that we've moved to our own Subversion, the trackers Guido> are the lsat part of the Python infrastructure that remains on Guido> SF. There's a perfectly capable replacement ready to wait on Guido> python.org. Maybe we should finally switch to roundup so we can

Re: [Python-Dev] Tracker anonymity

2005-12-07 Thread Guido van Rossum
On 12/7/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > You're preaching to the choir. I'm made the same argument over and over on > c.l.py, but there is a vocal minority there that believes the current state > of affairs is a barrier that prevents submissions. I definitely don't want anonymou

Re: [Python-Dev] Broader iterable support for xmlrpclib

2005-12-07 Thread Guido van Rossum
On 12/7/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > >> I then proposed the even wackier idea to simply allow all currently > >> unsupported iterables (sets and arrays seem the most obvious > >> candidates to me) to be marshalled as lists > > Raymond> Doesn't the appropriate

Re: [Python-Dev] Tracker anonymity

2005-12-07 Thread skip
>> Any thoughts about maybe relaxing the login restriction? Nick> If the submitter is anonymous, not only can we not follow up with Nick> any questions, neither does the submitter get notified of status Nick> changes on their tracker. You're preaching to the choir. I'm made the

Re: [Python-Dev] Broader iterable support for xmlrpclib

2005-12-07 Thread skip
>> I then proposed the even wackier idea to simply allow all currently >> unsupported iterables (sets and arrays seem the most obvious >> candidates to me) to be marshalled as lists Raymond> Doesn't the appropriate conversion depend on the contract Raymond> between the sender

Re: [Python-Dev] Documentation about Python's GC, python-dev list messages referenced in Modules/gcmodule.c not reachable anymore

2005-12-07 Thread Weber, Gregoire
Hi Neil, Hi Tim, Hi Simon, your responsive and valuable answers cleared up most of the open questions and gave a very positive impression to my project leader about the python community and python itself. Thank you very much! I'm trying to get more into the GC implementation before asking more

Re: [Python-Dev] Tracker anonymity

2005-12-07 Thread Nick Coghlan
[EMAIL PROTECTED] wrote: > In c.l.py Paul Rubin wrote: > > Paul> In the old days, it was possible to post stuff to Python's > Paul> sourceforge pages without logging in. That was turned off for > Paul> various reasons that weren't bogus, but that didn't strike me as > Paul> overwh

[Python-Dev] Tracker anonymity

2005-12-07 Thread skip
In c.l.py Paul Rubin wrote: Paul> In the old days, it was possible to post stuff to Python's Paul> sourceforge pages without logging in. That was turned off for Paul> various reasons that weren't bogus, but that didn't strike me as Paul> overwhelmingly compelling. Maybe that cou

Re: [Python-Dev] Broader iterable support for xmlrpclib

2005-12-07 Thread Raymond Hettinger
[Skip] > I then proposed the > even wackier idea to simply allow all currently unsupported iterables > (sets > and arrays seem the most obvious candidates to me) to be marshalled as > lists Doesn't the appropriate conversion depend on the contract between the sender and receiver (i.e. an array of