Re: [Python-Dev] test_itertools fails for trunk on x86 OS X machine

2006-09-21 Thread Neal Norwitz
On 9/21/06, Tim Peters <[EMAIL PROTECTED]> wrote: > > Well, to be strictly anal, while the result of > > (size_t)-123 > > is defined, the result of casting /that/ back to a signed type of the > same width is not defined. Maybe your compiler was "doing you a > favor" ;-) I also tried with a ca

Re: [Python-Dev] test_itertools fails for trunk on x86 OS X machine

2006-09-21 Thread Jack Diederich
On Thu, Sep 21, 2006 at 10:23:54PM -0700, Neal Norwitz wrote: > On 9/21/06, Jack Diederich <[EMAIL PROTECTED]> wrote: > > > > I should leave the tounge-in-cheek bombast to Tim and Frederik, especially > > when dealing with what might be an OS & machine specific bug. The next > > checkin and re-tes

Re: [Python-Dev] test_itertools fails for trunk on x86 OS X machine

2006-09-21 Thread Tim Peters
[Neal Norwitz] > It looks like %zd of a negative number is treated as an unsigned > number on OS X, even though the man page says it should be signed. > > """ > The z modifier, when applied to a d or i conversion, indicates that > the argument is of a signed type equivalent in size to a size_t. > "

Re: [Python-Dev] test_itertools fails for trunk on x86 OS X machine

2006-09-21 Thread Neal Norwitz
On 9/21/06, Jack Diederich <[EMAIL PROTECTED]> wrote: > > I should leave the tounge-in-cheek bombast to Tim and Frederik, especially > when dealing with what might be an OS & machine specific bug. The next > checkin and re-test will or won't highlight a failure and certainly someone > with a g4 wi

Re: [Python-Dev] test_itertools fails for trunk on x86 OS X machine

2006-09-21 Thread Jack Diederich
On Fri, Sep 22, 2006 at 06:09:41AM +0200, "Martin v. L?wis" wrote: > Jack Diederich schrieb: > > Faced with the choice of believing in a really strange platform specific > > bug in a commonly used routine that resulted in exactly the failure caused > > by one of the two files being updated or bel

Re: [Python-Dev] list.discard? (Re: dict.discard)

2006-09-21 Thread Steve Holden
Fred L. Drake, Jr. wrote: > On Thursday 21 September 2006 20:21, Greg Ewing wrote: > >if x not in somelist: > > somelist.remove(x) > > I'm just guessing you really meant "if x in somelist". ;-) > No you aren't, that's clearly an *informed* guess. regards Steve -- Steve Holden

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Steve Holden
Paul Moore wrote: > On 9/21/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > >>I think one missing feature is a mechanism whereby you can say "THIS >>package (gives top-level package name) lives HERE (gives filesystem >>location of package)" without adding the parent of HERE to sys.path >>for all

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Phillip J. Eby
At 08:44 PM 9/21/2006 -0700, Josiah Carlson wrote: >This can be implemented with a fairly simple package registry, contained >within a (small) SQLite database (which is conveniently shipped in >Python 2.5). There can be a system-wide database that all users use as >a base, with a user-defined pack

Re: [Python-Dev] test_itertools fails for trunk on x86 OS X machine

2006-09-21 Thread Martin v. Löwis
Jack Diederich schrieb: > Faced with the choice of believing in a really strange platform specific > bug in a commonly used routine that resulted in exactly the failure caused > by one of the two files being updated or believing a failure occurred in the > long chain of networks, disks, file syst

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Josiah Carlson
Greg Ewing <[EMAIL PROTECTED]> wrote: > > Guido van Rossum wrote: > > > Eek? If there are two third-party top-level packages A and B, by > > different third parties, and A depends on B, how should A find B if > > not via sys.path or something that is sufficiently equivalent as to > > have the sa

Re: [Python-Dev] list.discard? (Re: dict.discard)

2006-09-21 Thread skip
Greg> Actually I'd like [discard] for lists. It's obvious for sets and dictionaries that there is only one thing to discard and that after the operation you're guaranteed the key no longer exists. Would you want the same semantics for lists or the semantics of list.remove where it only remov

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Mark Hammond
Guido writes: > As Phillip understood, I meant the environment to include the > filesystem (and on Windows, the registry -- in fact, Python on Windows > *has* exactly such a mechanism in the registry, although I believe > it's rarely used these days -- it was done by Mark Hammond to support > COM

Re: [Python-Dev] test_itertools fails for trunk on x86 OS X machine

2006-09-21 Thread Grig Gheorghiu
On 9/21/06, Grig Gheorghiu <[EMAIL PROTECTED]> wrote: > On 9/21/06, Jack Diederich <[EMAIL PROTECTED]> wrote: > > On Thu, Sep 21, 2006 at 03:28:04PM -0700, Grig Gheorghiu wrote: > > > On 9/21/06, Jack Diederich <[EMAIL PROTECTED]> wrote: > > > > The python binary is out of step with the test_iterto

Re: [Python-Dev] test_itertools fails for trunk on x86 OS X machine

2006-09-21 Thread Grig Gheorghiu
On 9/21/06, Jack Diederich <[EMAIL PROTECTED]> wrote: > On Thu, Sep 21, 2006 at 03:28:04PM -0700, Grig Gheorghiu wrote: > > On 9/21/06, Jack Diederich <[EMAIL PROTECTED]> wrote: > > > The python binary is out of step with the test_itertools.py version. > > > You can generate this same error on your

Re: [Python-Dev] test_itertools fails for trunk on x86 OS X machine

2006-09-21 Thread Jack Diederich
On Thu, Sep 21, 2006 at 03:28:04PM -0700, Grig Gheorghiu wrote: > On 9/21/06, Jack Diederich <[EMAIL PROTECTED]> wrote: > > The python binary is out of step with the test_itertools.py version. > > You can generate this same error on your own box by reverting the > > change to itertoolsmodule.c but

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Phillip J. Eby
At 12:40 PM 9/22/2006 +1200, Greg Ewing wrote: >Guido van Rossum wrote: > > > While I agree with your idea(l), I don't think that's what Greg meant. > > He clearly say "sys.path should not exist at all". > >Refining that a bit, I don't think there should be >a *single* sys.path for the whole progra

Re: [Python-Dev] list.discard? (Re: dict.discard)

2006-09-21 Thread Josiah Carlson
Greg Ewing <[EMAIL PROTECTED]> wrote: > Gustavo Niemeyer wrote: > > > >>> print set.discard.__doc__ > > Remove an element from a set if it is a member. > > Actually I'd like this for lists. Often I find myself > writing > >if x not in somelist: > somelist.remove(x) > > A single me

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Scott Dial
Guido van Rossum wrote: > On 9/21/06, Greg Ewing <[EMAIL PROTECTED]> wrote: >> I think it goes further than that -- each module should >> (potentially) have its own unique view of the module >> namespace, defined at the time the module is installed, >> that can't be disturbed by anything that any o

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Greg Ewing
Guido van Rossum wrote: > While I agree with your idea(l), I don't think that's what Greg meant. > He clearly say "sys.path should not exist at all". Refining that a bit, I don't think there should be a *single* sys.path for the whole program -- more like each module having its own sys.path. And,

Re: [Python-Dev] list.discard? (Re: dict.discard)

2006-09-21 Thread Fred L. Drake, Jr.
On Thursday 21 September 2006 20:21, Greg Ewing wrote: >if x not in somelist: > somelist.remove(x) I'm just guessing you really meant "if x in somelist". ;-) -Fred -- Fred L. Drake, Jr. ___ Python-Dev mailing list Python-Dev@python.o

[Python-Dev] list.discard? (Re: dict.discard)

2006-09-21 Thread Greg Ewing
Gustavo Niemeyer wrote: > >>> print set.discard.__doc__ > Remove an element from a set if it is a member. Actually I'd like this for lists. Often I find myself writing if x not in somelist: somelist.remove(x) A single method for doing this would be handy, and more efficient. -- Gre

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Guido van Rossum
On 9/21/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > Giovanni Bajo wrote: > > > My idea (and interpretation of Greg's statement) is that a module/package > > should be able to live with either relative imports within itself, or fully > > absolute imports. > > I think it goes further than that -- eac

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Guido van Rossum
I think it would be worth writing up a PEP to describe this, if it's to become a de-facto standard. That might be a better path towards standardization than just checking in the code... :-/ --Guido On 9/21/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 12:07 PM 9/22/2006 +1200, Greg Ewing wro

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Greg Ewing
Giovanni Bajo wrote: > My idea (and interpretation of Greg's statement) is that a module/package > should be able to live with either relative imports within itself, or fully > absolute imports. I think it goes further than that -- each module should (potentially) have its own unique view of the

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Guido van Rossum
On 9/21/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > > Eek? If there are two third-party top-level packages A and B, by > > different third parties, and A depends on B, how should A find B if > > not via sys.path or something that is sufficiently equivalent as to > > have

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Phillip J. Eby
At 12:07 PM 9/22/2006 +1200, Greg Ewing wrote: >Another thought on static module namespace configuration: >It would make things a *lot* easier for py2exe, py2app >and the like that have to figure out what packages >a program depends on without running the program. Setuptools users already explicit

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Greg Ewing
Another thought on static module namespace configuration: It would make things a *lot* easier for py2exe, py2app and the like that have to figure out what packages a program depends on without running the program. -- Greg ___ Python-Dev mailing list Pyth

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Greg Ewing
Guido van Rossum wrote: > Eek? If there are two third-party top-level packages A and B, by > different third parties, and A depends on B, how should A find B if > not via sys.path or something that is sufficiently equivalent as to > have the same problems? Some kind of configuration mechanism is

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Phillip J. Eby
At 03:28 PM 9/21/2006 -0700, Guido van Rossum wrote: >os.environ is useless because there's no way for a package installer >to set it for all users. Or even for *one* user! :) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mai

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Guido van Rossum
On 9/21/06, Paul Moore <[EMAIL PROTECTED]> wrote: > On 9/21/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > Isn't the main problem how to specify a bunch of these in the > > environment? Or can this be done through .pkg files? Those aren't > > cheap either though -- it would be best if the work

Re: [Python-Dev] test_itertools fails for trunk on x86 OS X machine

2006-09-21 Thread Grig Gheorghiu
On 9/21/06, Jack Diederich <[EMAIL PROTECTED]> wrote: > The python binary is out of step with the test_itertools.py version. > You can generate this same error on your own box by reverting the > change to itertoolsmodule.c but leaving the new test in test_itertools.py > > I don't know why this only

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Brett Cannon
On 9/21/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: On 9/21/06, Paul Moore <[EMAIL PROTECTED]> wrote:[SNIP]> Hmm, I might play with this - a set of PEP 302 importers to completely> customise the import mechanism. The never-completed "phase 2" of the > PEP included a reimplementation of the buil

Re: [Python-Dev] test_itertools fails for trunk on x86 OS X machine

2006-09-21 Thread Jack Diederich
The python binary is out of step with the test_itertools.py version. You can generate this same error on your own box by reverting the change to itertoolsmodule.c but leaving the new test in test_itertools.py I don't know why this only happened on that OSX buildslave On Thu, Sep 21, 2006 at 02:34

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Paul Moore
On 9/21/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > >Isn't the main problem how to specify a bunch of these in the > >environment? > > Yes, that's exactly the problem, assuming that by environment you mean the > operating environment, as opposed to e.g. os.environ. Hmm, now I don't understand

[Python-Dev] test_itertools fails for trunk on x86 OS X machine

2006-09-21 Thread Grig Gheorghiu
One of the Pybots buildslaves has been failing the 'test' step, with the culprit being test_itertools: test_itertools test test_itertools failed -- Traceback (most recent call last): File "/Users/builder/pybots/pybot/trunk.osaf-x86/build/Lib/test/test_itertools.py", line 62, in test_count se

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Phillip J. Eby
At 01:54 PM 9/21/2006 -0700, Guido van Rossum wrote: >On 9/21/06, Paul Moore <[EMAIL PROTECTED]> wrote: > > On 9/21/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > I think one missing feature is a mechanism whereby you can say "THIS > > > package (gives top-level package name) lives HERE (giv

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Paul Moore
On 9/21/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: On 9/21/06, Paul Moore <[EMAIL PROTECTED]> wrote: > On 9/21/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > I think one missing feature is a mechanism whereby you can say "THIS > > package (gives top-level package name) lives HERE (gives

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Guido van Rossum
On 9/21/06, Paul Moore <[EMAIL PROTECTED]> wrote: > On 9/21/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > I think one missing feature is a mechanism whereby you can say "THIS > > package (gives top-level package name) lives HERE (gives filesystem > > location of package)" without adding the p

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Paul Moore
On 9/21/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > I think one missing feature is a mechanism whereby you can say "THIS > package (gives top-level package name) lives HERE (gives filesystem > location of package)" without adding the parent of HERE to sys.path > for all module searches. I thi

[Python-Dev] Weekly Python Patch/Bug Summary ** REVISED **

2006-09-21 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 420 open ( +4) / 3410 closed ( +2) / 3830 total ( +6) Bugs: 915 open (+17) / 6186 closed ( +6) / 7101 total (+23) RFE : 235 open ( +1) / 238 closed ( +0) / 473 total ( +1) New / Reopened Patches __ Practical

Re: [Python-Dev] release25-maint is UNFROZEN

2006-09-21 Thread Neal Norwitz
On 9/21/06, Armin Rigo <[EMAIL PROTECTED]> wrote: > Hi Anthony, > > On Thu, Sep 21, 2006 at 09:12:03PM +1000, Anthony Baxter wrote: > > Thanks to everyone for helping make 2.5 happen. It's been a long slog there, > > but I think we can all be proud of the result. > > Thanks for the hassle! I've go

Re: [Python-Dev] win32 - results from Lib/test - 2.5 release-maint

2006-09-21 Thread Martin v. Löwis
Please submit a patch to sf.net/projects/python. > - *.txt files for unicode tests are downloaded from internet - I don't > like this. What files specifcally? Could it be that you passed -u urlfetch or -u all? If so, then just don't. > - init_types is declared static in python/python-ast.c and

Re: [Python-Dev] win32 - results from Lib/test - 2.5 release-maint

2006-09-21 Thread Brett Cannon
On 9/21/06, Grzegorz Makarewicz <[EMAIL PROTECTED]> wrote: Hi,- *.txt files for unicode tests are downloaded from internet - I don'tlike this.Then don't use the urlfetch resource when running regrtest.py (which you did specify when you ran with ``-uall``). - __db.004 isn't removed after tests- init

Re: [Python-Dev] GCC 4.x incompatibility

2006-09-21 Thread Martin v. Löwis
Georg Brandl schrieb: > Is it noted somewhere that building Python with GCC 4.x results in > problems such as abs(-sys.maxint-1) being negative? Yes, it's in the README (although it claims problems only exist with 4.1 and 4.2; 4.0 seems to work fine for me). > I think this is something users may

[Python-Dev] win32 - results from Lib/test - 2.5 release-maint

2006-09-21 Thread Grzegorz Makarewicz
Hi, - *.txt files for unicode tests are downloaded from internet - I don't like this. - __db.004 isn't removed after tests - init_types is declared static in python/python-ast.c and cant be imported from PC/config.c. - python_d -u regrtest.py -u bsddb -u curses -uall -v = dies after testInfinit

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Guido van Rossum
On 9/21/06, Giovanni Bajo <[EMAIL PROTECTED]> wrote: > >> Greg Eqing wrote: > >> There really shouldn't be > >> any such thing as sys.path -- the view that any > >> given module has of the package namespace should > >> depend only on where it is > My idea (and interpretation of Greg's statement) i

Re: [Python-Dev] dict.discard

2006-09-21 Thread Gustavo Niemeyer
> Would the argument be the key, or the pair? I'd guess the key. Right, the key. > If so, there's the 2-arg flavor of dict.pop(): > > >>> d = {} > >>> d.pop("key", None) > > It's not terribly obvious, but does the job without enlarging > the dict API. Yeah, this looks good. I don't think

Re: [Python-Dev] dict.discard

2006-09-21 Thread Fred L. Drake, Jr.
On Thursday 21 September 2006 09:42, Gustavo Niemeyer wrote: > After trying to use it a few times with no success :-), I'd like > > to include a new method, dict.discard, mirroring set.discard: > >>> print set.discard.__doc__ > > Remove an element from a set if it is a member. > > If

[Python-Dev] dict.discard

2006-09-21 Thread Gustavo Niemeyer
Hey guys, After trying to use it a few times with no success :-), I'd like to include a new method, dict.discard, mirroring set.discard: >>> print set.discard.__doc__ Remove an element from a set if it is a member. If the element is not a member, do nothing. Comments? -- Gustavo Nieme

Re: [Python-Dev] Small Py3k task: fix modulefinder.py

2006-09-21 Thread Thomas Heller
Guido van Rossum schrieb: > Is anyone familiar enough with modulefinder.py to fix its breakage in > Py3k? It chokes in a nasty way (exceeding the recursion limit) on the > relative import syntax. I suspect this is also a problem for 2.5, when > people use that syntax; hence the cross-post. There's

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Giovanni Bajo
Oleg Broytmann wrote: >> There really shouldn't be >> any such thing as sys.path -- the view that any >> given module has of the package namespace should >> depend only on where it is > >I do not understand this. Can you show an example? Imagine I have > two servers, Linux and FreeBSD, and on

Re: [Python-Dev] New relative import issue

2006-09-21 Thread Steve Holden
Guido van Rossum wrote: > On 9/19/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > >>I haven't really thought it through in detail. It >>just seems as though it would be a lot less confusing >>if you could figure out from static information which >>module will get imported by a given import statement,

Re: [Python-Dev] release25-maint is UNFROZEN

2006-09-21 Thread Armin Rigo
Hi Anthony, On Thu, Sep 21, 2006 at 09:12:03PM +1000, Anthony Baxter wrote: > Thanks to everyone for helping make 2.5 happen. It's been a long slog there, > but I think we can all be proud of the result. Thanks for the hassle! I've got another bit of it for you, though. The freezed 2.5 documen

[Python-Dev] GCC 4.x incompatibility

2006-09-21 Thread Georg Brandl
Is it noted somewhere that building Python with GCC 4.x results in problems such as abs(-sys.maxint-1) being negative? I think this is something users may want to know. Perhaps the "Known Bugs" page at http://www.python.org/download/releases/2.5/bugs/ is the right place to put this info. Georg

[Python-Dev] release25-maint is UNFROZEN

2006-09-21 Thread Anthony Baxter
Ok - it's been 48 hours, and I've not seen any brown-paper-bag bugs, so I'm declaring the 2.5 maintenance branch open for business. As specified in PEP-006, this is a maintenance branch only suitable for bug fixes. No functionality changes should be checked in without discussion and agreement o

Re: [Python-Dev] IronPython and AST branch

2006-09-21 Thread Nick Coghlan
Guido van Rossum wrote: > On 9/17/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: >> One of the biggest issues I have with the current AST is that I don't >> believe >> it really gets the "slice" and "extended slice" terminology correct >> (it uses >> 'extended slice' to refer to multi-dimensional in

Re: [Python-Dev] Removing __del__

2006-09-21 Thread Nick Coghlan
Nick Coghlan wrote: > Adding pydev back in, since these seem like reasonable questions to me :) D'oh, that should have been python-3000 not python-dev :( Sorry for the noise, folks. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia ---

Re: [Python-Dev] Removing __del__

2006-09-21 Thread Nick Coghlan
Adding pydev back in, since these seem like reasonable questions to me :) Jim Jewett wrote: > On 9/20/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: >> # Create a class with the same instance attributes >> # as the original >> class attr_holder(object): >>