Re: [Python-Dev] Problems building Python on OSX 10.4.6?

2006-06-26 Thread Ronald Oussoren
On 26-jun-2006, at 23:03, J. Jeffrey Close wrote: > [Bleh, sorry about the subject line on my first post. > Forgot to edit it before I sent.] > > > Hi all, > > I have been trying for some time to build Python 2.4.x > from source on OS X 10.4.6. I've found *numerous* > postings on various mailing

Re: [Python-Dev] PEP 3103: A Switch/Case Statement

2006-06-26 Thread Guido van Rossum
On 6/26/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > > Most school I proponents (perhaps you're the only exception) have > > claimed that optimization is desirable, but added that it would be > > easy to add hash-based optimization. IMO it's not so easy in the light >

Re: [Python-Dev] PEP 3103: A Switch/Case Statement

2006-06-26 Thread Fredrik Lundh
Guido van Rossum wrote: > Most school I proponents (perhaps you're the only exception) have > claimed that optimization is desirable, but added that it would be > easy to add hash-based optimization. IMO it's not so easy in the light > of various failure modes of hash(). (A possible solution would

Re: [Python-Dev] Semantic of isinstance

2006-06-26 Thread Guido van Rossum
On 6/26/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > Phillip J. Eby wrote: > > > It's not inconsistent - isinstance() checks __class__ in *addition* to > > type() in order to allow proxying tricks like lying about your > > __class__. > > If this is a deliberate feature, it's a bit patchy, because >

Re: [Python-Dev] PEP 3103: A Switch/Case Statement

2006-06-26 Thread Guido van Rossum
On 6/26/06, Ka-Ping Yee <[EMAIL PROTECTED]> wrote: > On Mon, 26 Jun 2006, Guido van Rossum wrote: > > Most school I proponents (perhaps you're the only exception) have > > claimed that optimization is desirable, but added that it would be > > easy to add hash-based optimization. IMO it's not so eas

Re: [Python-Dev] Semantic of isinstance

2006-06-26 Thread Greg Ewing
Phillip J. Eby wrote: > It's not inconsistent - isinstance() checks __class__ in *addition* to > type() in order to allow proxying tricks like lying about your > __class__. If this is a deliberate feature, it's a bit patchy, because it means the proxy can't lie about *not* being an instance of

Re: [Python-Dev] [Python-checkins] Things to remember when adding *packages* to stdlib

2006-06-26 Thread Neal Norwitz
On 6/25/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Neal Norwitz wrote: > > I believe this change is all that's necessary on the Unix side to > > install wsgiref. Can someone please update the Windows build files to > > ensure wsgiref is installed in b2? Don't forget to update the NEWS > >

Re: [Python-Dev] Semantic of isinstance

2006-06-26 Thread Phillip J. Eby
At 08:04 PM 6/26/2006 -0700, Martin Maly wrote: >Thanks for the response. The code snippet I sent deals with new style >classes only so I assume that in some cases isinstance falls back to >old-style-like handling which then asks for __bases__ and __class__ etc, >possibly incorrectly so on new s

Re: [Python-Dev] Semantic of isinstance

2006-06-26 Thread Phillip J. Eby
At 05:16 PM 6/26/2006 -0700, Martin Maly wrote: > >>> class D(object): >... def getclass(self): >... print "D.getclass" >... return C >... __class__ = property(getclass) >... > >>> isinstance(D(), D) >True > >>> isinstance(D(), C) >D.getclass >True > >isinstance in this case

Re: [Python-Dev] Semantic of isinstance

2006-06-26 Thread Martin Maly
Thanks for the response. The code snippet I sent deals with new style classes only so I assume that in some cases isinstance falls back to old-style-like handling which then asks for __bases__ and __class__ etc, possibly incorrectly so on new style classes. Thanks again! Martin -Original M

Re: [Python-Dev] Semantic of isinstance

2006-06-26 Thread Greg Ewing
Martin Maly wrote: isinstance(D(), D) > > True > isinstance(D(), C) > > D.getclass > True This looks like a new/old class thing. Presumably once everything is changed over to new-style classes, this inconsistency will go away. And from the current behaviour, it looks like __class__ and

Re: [Python-Dev] doc for new restricted execution design for Python

2006-06-26 Thread Brett Cannon
On 6/26/06, Ka-Ping Yee <[EMAIL PROTECTED]> wrote: Hi, Brett.> I have been working on a design doc for restricted execution of PythonI'm excited to see that you're working on this.Yeah, I just hope I have a design that works.  =) > as part of my dissertation for getting Python into Firefox to repl

Re: [Python-Dev] doc for new restricted execution design for Python

2006-06-26 Thread Ka-Ping Yee
Hi, Brett. > I have been working on a design doc for restricted execution of Python I'm excited to see that you're working on this. > as part of my dissertation for getting Python into Firefox to replace > JavaScript on the web. Wow. What's your game plan? Do you have a story for convincing t

[Python-Dev] Semantic of isinstance

2006-06-26 Thread Martin Maly
Hello Python Dev, I am trying to understand the correct semantic of the isinstance built-in function and while doing so, I came across few cases which raise some questions. 1) First example - a class instance pretends to have different class via __class__. >>> class D(object): ... def getc

Re: [Python-Dev] Simple Switch statement

2006-06-26 Thread Michael Urman
On 6/26/06, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > With the simplified proposal, this would be coded with an inverse mapping: > > for event in pygame.event.get(): > switch eventmap[event.type]: > case 'KEYDOWN': ... > case 'KEYUP': ... > case 'QUIT': ...

Re: [Python-Dev] ImportWarning flood

2006-06-26 Thread Ralf W. Grosse-Kunstleve
--- "Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> wrote: > Michael Hudson wrote: > > > Benji York <[EMAIL PROTECTED]> writes: > > > >> Nick Coghlan wrote: > >>> Perhaps ImportWarning should default to being ignored, the same way > >>> PendingDeprecationWarning does? > >>> > >>> Then -Wd would be

Re: [Python-Dev] Python-Dev Digest, Vol 35, Issue 143

2006-06-26 Thread J. Jeffrey Close
Hi all, Sorry for my inappropriate posting. I just joined the list and didn't realize the complete scope. I will stay on the list, I'm very interested in it from a semantics & implementation perspective as well. Thanks to Brett for the heads-up. Jeff --- Brett Cannon <[EMAIL PROTECTED]>

Re: [Python-Dev] School IIb?

2006-06-26 Thread Phillip J. Eby
At 03:52 PM 6/26/2006 -0700, Guido van Rossum wrote: >It's the >messiness of trying to define rules that are as flexible as needed for >optimization and yet claiming to maintain the strict if/elif-chain >semantics. Hear, hear! We already have if/elif, we don't need another way to spell it. The

Re: [Python-Dev] School IIb?

2006-06-26 Thread Guido van Rossum
On 6/26/06, Ka-Ping Yee <[EMAIL PROTECTED]> wrote: > Here's a possible adjustment to the School-II approach that i think > avoids the issues i've been raising, while giving the desired > O(n)-to-O(1) speedup in common situations. It's basically School-II > dispatch, plus a check: > > On compilatio

[Python-Dev] School IIb?

2006-06-26 Thread Ka-Ping Yee
Here's a possible adjustment to the School-II approach that i think avoids the issues i've been raising, while giving the desired O(n)-to-O(1) speedup in common situations. It's basically School-II dispatch, plus a check: On compilation, freeze any cases that meet the School-II conditions and hav

Re: [Python-Dev] PEP 3103: A Switch/Case Statement

2006-06-26 Thread Ka-Ping Yee
On Mon, 26 Jun 2006, Guido van Rossum wrote: > Most school I proponents (perhaps you're the only exception) have > claimed that optimization is desirable, but added that it would be > easy to add hash-based optimization. IMO it's not so easy in the light > of various failure modes of hash(). (A pos

[Python-Dev] enhancements for uuid module

2006-06-26 Thread Michael Amrhein
Hi Ka-Ping, I would like to propose two enhancements for your uuid module in Python 2.5: 1) I've written functions to retrieve the MAC address that do not depend on running external programs. Please see the attached file. 2) In order to reduce the pickle footprint of UUIDs I would add a __red

Re: [Python-Dev] pypy-0.9.0: stackless, new extension compiler

2006-06-26 Thread Ben . Young
Congratulations! [EMAIL PROTECTED] wrote on 25/06/2006 13:07:01: > The PyPy development team has been busy working and we've now packaged > our latest improvements, completed work and new experiments as > version 0.9.0, our fourth public release. > > The highlights of this fourth release of P

Re: [Python-Dev] PEP 3103: A Switch/Case Statement

2006-06-26 Thread Guido van Rossum
On 6/26/06, Ka-Ping Yee <[EMAIL PROTECTED]> wrote: > On Mon, 26 Jun 2006, Guido van Rossum wrote: > > Can you please edit the PEP yourself to add this? That will be most > > efficient. > > I've done so, and tried to clarify the next line to match (see below). > > > With school I, if you want to >

Re: [Python-Dev] ImportWarning flood

2006-06-26 Thread Delaney, Timothy (Tim)
Michael Hudson wrote: > Benji York <[EMAIL PROTECTED]> writes: > >> Nick Coghlan wrote: >>> Perhaps ImportWarning should default to being ignored, the same way >>> PendingDeprecationWarning does? >>> >>> Then -Wd would become 'the one obvious way' to debug import problems >> >> +1 > > I'm not

[Python-Dev] Problems building Python on OSX 10.4.6?

2006-06-26 Thread J. Jeffrey Close
[Bleh, sorry about the subject line on my first post. Forgot to edit it before I sent.] Hi all, I have been trying for some time to build Python 2.4.x from source on OS X 10.4.6. I've found *numerous* postings on various mailing lists and web pages documenting the apparently well-known problem

Re: [Python-Dev] Python-Dev Digest, Vol 35, Issue 143

2006-06-26 Thread Brett Cannon
tion on "Packages" in> the Python tutorial for>   details (http://www.python.org/doc/tut/ ).> >>>>>> The "No module named" message is repeated in these> files (2.5b1 tree):>> ./Demo/imputil/knee.py> ./Lib/ihooks.py> ./Lib/modulefinder.py >

Re: [Python-Dev] Python-Dev Digest, Vol 35, Issue 143

2006-06-26 Thread J. Jeffrey Close
he Python tutorial for > details (http://www.python.org/doc/tut/). > >>> > > > The "No module named" message is repeated in these > files (2.5b1 tree): > > ./Demo/imputil/knee.py > ./Lib/ihooks.py > ./Lib/modulefinder.py > ./Lib/xmlcore/etree/Eleme

Re: [Python-Dev] PEP 3103: A Switch/Case Statement

2006-06-26 Thread Ka-Ping Yee
On Mon, 26 Jun 2006, Guido van Rossum wrote: > Can you please edit the PEP yourself to add this? That will be most efficient. I've done so, and tried to clarify the next line to match (see below). > With school I, if you want to > optimize using a hash table (as in PEP 275 Solution 1) you have to

Re: [Python-Dev] Switch statement

2006-06-26 Thread Guido van Rossum
On 6/26/06, Jim Jewett <[EMAIL PROTECTED]> wrote: > In http://mail.python.org/pipermail/python-dev/2006-June/066475.html > Nick Coghlan wrote: > > > (Unlike Jim, I have no problems with restricting switch statements to > > hashable objects and building the entire jump table at once - if what you >

[Python-Dev] Switch statement

2006-06-26 Thread Jim Jewett
In http://mail.python.org/pipermail/python-dev/2006-June/066475.html Nick Coghlan wrote: > (Unlike Jim, I have no problems with restricting switch statements to > hashable objects and building the entire jump table at once - if what you want > is an arbitrary if-elif chain, then write one!) I hav

Re: [Python-Dev] PEP 3103: A Switch/Case Statement

2006-06-26 Thread Guido van Rossum
On 6/26/06, Ka-Ping Yee <[EMAIL PROTECTED]> wrote: > On Mon, 26 Jun 2006, Guido van Rossum wrote: > > I've written a new PEP, summarizing (my reaction to) the recent > > discussion on adding a switch statement. While I have my preferences, > > I'm trying to do various alternatives justice in the de

Re: [Python-Dev] Misleading error message from PyObject_GenericSetAttr

2006-06-26 Thread Alexander Belopolsky
On 6/19/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 6/14/06, Alexander Belopolsky <[EMAIL PROTECTED]> wrote: > > ... It would be better to change the message > > to "'Foo' object has only read-only attributes (assign to .bar)" as in > > the case tp_setattro == tp_setattr == NULL in PyObje

Re: [Python-Dev] PEP 3103: A Switch/Case Statement

2006-06-26 Thread Ka-Ping Yee
On Mon, 26 Jun 2006, Guido van Rossum wrote: > I've written a new PEP, summarizing (my reaction to) the recent > discussion on adding a switch statement. While I have my preferences, > I'm trying to do various alternatives justice in the descriptions. Thanks for writing this up! The section that

[Python-Dev] PEP 3103: A Switch/Case Statement

2006-06-26 Thread Guido van Rossum
I've written a new PEP, summarizing (my reaction to) the recent discussion on adding a switch statement. While I have my preferences, I'm trying to do various alternatives justice in the descriptions. The PEP also introduces some standard terminology that may be helpful in future discussions. I'm p

Re: [Python-Dev] ImportWarning flood

2006-06-26 Thread Benji York
Michael Hudson wrote: > Benji York <[EMAIL PROTECTED]> writes: > >>Nick Coghlan wrote: >> >>>Perhaps ImportWarning should default to being ignored, the same way >>>PendingDeprecationWarning does? >>> >>>Then -Wd would become 'the one obvious way' to debug import problems >> >>+1 > > I'm not sure

Re: [Python-Dev] ImportWarning flood

2006-06-26 Thread Michael Hudson
Benji York <[EMAIL PROTECTED]> writes: > Nick Coghlan wrote: >> Perhaps ImportWarning should default to being ignored, the same way >> PendingDeprecationWarning does? >> >> Then -Wd would become 'the one obvious way' to debug import problems > > +1 I'm not sure what this would achieve -- people

Re: [Python-Dev] Simple Switch statement

2006-06-26 Thread Raymond Hettinger
Michael Urman wrote: > I'm trying to find some real world examples of a pygame event loop > >that really show the benefit of supporting named constants and >expressions. I may mess up irrelevant details, but the primary case >looks something like the following (perhaps Pete Shinners could point >u

Re: [Python-Dev] pypy-0.9.0: stackless, new extension compiler

2006-06-26 Thread Carl Friedrich Bolz
Hi all! Michael Hudson wrote: > The PyPy development team has been busy working and we've now packaged > our latest improvements, completed work and new experiments as > version 0.9.0, our fourth public release. Unfortunately the download links for the release tarballs did not work until very

Re: [Python-Dev] Simple Switch statement

2006-06-26 Thread Guido van Rossum
On 6/26/06, Michael Urman <[EMAIL PROTECTED]> wrote: > I also would like to see a way to use 'is' instead of (or inaddition > to) '==' for the comparison, but I don't have any use cases behind > this. I've thought about this a bit, and I think it's a red herring. I've seen some places where 'is' i

Re: [Python-Dev] ImportWarning flood

2006-06-26 Thread Nick Coghlan
A.M. Kuchling wrote: > On Mon, Jun 26, 2006 at 08:29:49AM +0200, "Martin v. Löwis" wrote: >> (read some email archives >> to find out what the original problem was). > > People at Google don't read manuals? The documentation of how imports actually work isn't that easy to find? Guido's package e

Re: [Python-Dev] Simple Switch statement

2006-06-26 Thread Michael Urman
On 6/25/06, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > Those were not empty words. I provided two non-trivial worked-out examples > taken from sre_constants.py and opcode.py. Nick provided a third example from > decimal.py. In all three cases, the proposal was applied effortlessly > resulti

Re: [Python-Dev] ImportWarning flood

2006-06-26 Thread Benji York
Nick Coghlan wrote: > Perhaps ImportWarning should default to being ignored, the same way > PendingDeprecationWarning does? > > Then -Wd would become 'the one obvious way' to debug import problems +1 -- Benji York ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] ImportWarning flood

2006-06-26 Thread A.M. Kuchling
On Mon, Jun 26, 2006 at 08:29:49AM +0200, "Martin v. Löwis" wrote: > (read some email archives > to find out what the original problem was). People at Google don't read manuals? --amk ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.

Re: [Python-Dev] ImportWarning flood

2006-06-26 Thread Michael Hudson
James Y Knight <[EMAIL PROTECTED]> writes: > On Jun 24, 2006, at 1:29 PM, Ralf W. Grosse-Kunstleve wrote: > >> --- Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >>> I think it is safe to say that Twisted is more widely used than >>> anything >>> Google has yet released. Twisted also has a reas

Re: [Python-Dev] 2.5b1 Windows install

2006-06-26 Thread Nick Coghlan
Aahz wrote: > Has anyone else tried doing an admin install with "compile .py files" > checked? It's causing my install to blow up, but I'd prefer to assume > it's some weird Windows config/bug unless other people also have it, in > which case I'll file an SF report. I tried this deliberately with

Re: [Python-Dev] ImportWarning flood

2006-06-26 Thread Ralf W. Grosse-Kunstleve
--- "Martin v. L�wis" <[EMAIL PROTECTED]> wrote: > So spend some of the money to come up with an alternate solution for > 2.5b2. With a potential damage of a million dollars, it shouldn't be > too difficult to provide a patch by tomorrow, right? My share is only 10 man hours, payed for by the US

Re: [Python-Dev] ImportWarning flood

2006-06-26 Thread Nick Coghlan
Guido van Rossum wrote: > On 6/24/06, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >>> Actually, your application *was* pretty close to being broken a few >>> weeks ago, when Guido wanted to drop the requirement that a package >>> must contain an __init__ file. In that case, "import math" would h