Re: [Python-3000] C API for ints and strings

2007-09-10 Thread Marcin 'Qrczak' Kowalczyk
Dnia 09-09-2007, N o godzinie 21:27 -0400, Jim Jewett napisał(a): > If python handled small ints itself, and only farmed out the "large" > ones, If GMP is used, it's definitely worth to have a non-GMP representation for small integers, because GMP itself does not do it. A GMP integer is represent

[Python-3000] __format__ and datetime

2007-09-10 Thread Eric Smith
I have a patch to add __format__ to datetime.time, .date, and .datetime. For non-empty format_spec's, I just pass on to .strftime. For empty format_spec's, it returns str(self). I think this is the only reasonable interpretation of format_spec's for datetime. Does anyone think otherwise? E

Re: [Python-3000] __format__ and datetime

2007-09-10 Thread Martin v. Löwis
> I have a patch to add __format__ to datetime.time, .date, and .datetime. > For non-empty format_spec's, I just pass on to .strftime. For empty > format_spec's, it returns str(self). > > I think this is the only reasonable interpretation of format_spec's for > datetime. Does anyone think o

Re: [Python-3000] __format__ and datetime

2007-09-10 Thread Eric Smith
Martin v. Löwis wrote: >> I have a patch to add __format__ to datetime.time, .date, and .datetime. >> For non-empty format_spec's, I just pass on to .strftime. For empty >> format_spec's, it returns str(self). >> >> I think this is the only reasonable interpretation of format_spec's for >> da

Re: [Python-3000] __format__ and datetime

2007-09-10 Thread Paul Moore
On 10/09/2007, Eric Smith <[EMAIL PROTECTED]> wrote: > Martin v. Löwis wrote: > >> I have a patch to add __format__ to datetime.time, .date, and .datetime. > >> For non-empty format_spec's, I just pass on to .strftime. For empty > >> format_spec's, it returns str(self). > >> > >> I think this is

Re: [Python-3000] __format__ and datetime

2007-09-10 Thread Eric Smith
Eric Smith wrote: > Martin v. Löwis wrote: >>> I have a patch to add __format__ to datetime.time, .date, and .datetime. >>> For non-empty format_spec's, I just pass on to .strftime. For empty >>> format_spec's, it returns str(self). >>> >>> I think this is the only reasonable interpretation of

Re: [Python-3000] [Python-3000-checkins] r58068 - in python/branches/py3k: Doc/library/exceptions.rst Doc/library/socket.rst Doc/whatsnew/2.6.rst Lib/test/test_urllib2net.py Lib/urllib2.py Modules/soc

2007-09-10 Thread Thomas Wouters
On 9/10/07, gregory.p.smith <[EMAIL PROTECTED]> wrote: > > Author: gregory.p.smith > Date: Mon Sep 10 01:55:55 2007 > New Revision: 58068 > > Modified: >python/branches/py3k/Doc/library/exceptions.rst >python/branches/py3k/Doc/library/socket.rst >python/branches/py3k/Doc/whatsnew/2.6.rs

Re: [Python-3000] [Python-3000-checkins] r58068 - in python/branches/py3k: Doc/library/exceptions.rst Doc/library/socket.rst Doc/whatsnew/2.6.rst Lib/test/test_urllib2net.py Lib/urllib2.py Modules/soc

2007-09-10 Thread Bill Janssen
> svnmerge should come with svn, nowadays, or you can download it separately > (as svnmerge.py, probably; it's just a Python script.) It comes with version 3 of svn. Or http://svn.collab.net/repos/svn/trunk/contrib/client-side/svnmerge/svnmerge.py. Bill _

Re: [Python-3000] [Python-3000-checkins] r58068 - in python/branches/py3k: Doc/library/exceptions.rst Doc/library/socket.rst Doc/whatsnew/2.6.rst Lib/test/test_urllib2net.py Lib/urllib2.py Modules/soc

2007-09-10 Thread Bill Janssen
> It comes with version 3 of svn. Sorry, that should be 1.3. But I see I've got version 1.4.4 installed, and no svnmerge. Of course, this is Apple's XCode version of svn. Bill ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/

Re: [Python-3000] C API for ints and strings

2007-09-10 Thread Guido van Rossum
On 9/9/07, Nicholas Bastin <[EMAIL PROTECTED]> wrote: > On 9/9/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > On 9/9/07, Nicholas Bastin <[EMAIL PROTECTED]> wrote: > > > I'm not suggesting that Python handle small ints itself and then farm > > > out large integer computations, I'm suggesting

Re: [Python-3000] [Python-3000-checkins] r58068 - in python/branches/py3k: Doc/library/exceptions.rst Doc/library/socket.rst Doc/whatsnew/2.6.rst Lib/test/test_urllib2net.py Lib/urllib2.py Modules/soc

2007-09-10 Thread Gregory P. Smith
On 9/10/07, Thomas Wouters <[EMAIL PROTECTED]> wrote: > > > On 9/10/07, gregory.p.smith <[EMAIL PROTECTED] > wrote: > > > > Author: gregory.p.smith > > Date: Mon Sep 10 01:55:55 2007 > > New Revision: 58068 > > > > Modified: > >python/branches/py3k/Doc/library/exceptions.rst > >python/branc

Re: [Python-3000] __format__ and datetime

2007-09-10 Thread Guido van Rossum
On 9/10/07, Eric Smith <[EMAIL PROTECTED]> wrote: > I have a patch to add __format__ to datetime.time, .date, and .datetime. > For non-empty format_spec's, I just pass on to .strftime. For empty > format_spec's, it returns str(self). > > I think this is the only reasonable interpretation of form

Re: [Python-3000] [Python-3000-checkins] r58068 - in python/branches/py3k: Doc/library/exceptions.rst Doc/library/socket.rst Doc/whatsnew/2.6.rst Lib/test/test_urllib2net.py Lib/urllib2.py Modules/soc

2007-09-10 Thread Paul Moore
On 10/09/2007, Thomas Wouters <[EMAIL PROTECTED]> wrote: > svnmerge should come with svn, nowadays, or you can download it separately > (as svnmerge.py, probably; it's just a Python script.) It's not part of the Win32 binary distribution for Subversion - but I found it at http://www.orcaware.com/s

Re: [Python-3000] [Python-3000-checkins] r58068 - in python/branches/py3k: Doc/library/exceptions.rst Doc/library/socket.rst Doc/whatsnew/2.6.rst Lib/test/test_urllib2net.py Lib/urllib2.py Modules/soc

2007-09-10 Thread Mike Klaas
On 10-Sep-07, at 8:33 AM, Thomas Wouters wrote: > Alternatively, if you know what you're doing, you can edit the > svnmerge-integrated property on the branch directly -- but don't > mess it up :) > svnmerge also has a handy -M flag that marks a (set of) revisions as merged, but doesn't act

Re: [Python-3000] C API for ints and strings

2007-09-10 Thread Nicholas Bastin
On 9/10/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 9/9/07, Nicholas Bastin <[EMAIL PROTECTED]> wrote: > > On 9/9/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > On 9/9/07, Nicholas Bastin <[EMAIL PROTECTED]> wrote: > > > > I'm not suggesting that Python handle small ints itself and

Re: [Python-3000] C API for ints and strings

2007-09-10 Thread Guido van Rossum
On 9/10/07, Nicholas Bastin <[EMAIL PROTECTED]> wrote: > > > I did redo my benchmark using 200 as the increment number instead of > > > 1, to duck any impact from the interning of small value ints in 2.6, > > > and it made no discernible difference in the results. > > > > I'm sorry, I've lost conte

Re: [Python-3000] C API for ints and strings

2007-09-10 Thread Nicholas Bastin
On 9/10/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 9/10/07, Nicholas Bastin <[EMAIL PROTECTED]> wrote: > > > > I did redo my benchmark using 200 as the increment number instead of > > > > 1, to duck any impact from the interning of small value ints in 2.6, > > > > and it made no discernib

Re: [Python-3000] C API for ints and strings

2007-09-10 Thread Greg Ewing
Martin v. Löwis wrote: > The first right of the user is to get the source code > easily, without having to beg for it. Only then it is also > the user's right to modify it, and use the modified version > in the application. Where does begging come into it? As long as the user is provided with inf

Re: [Python-3000] C API for ints and strings

2007-09-10 Thread Larry Hastings
Greg Ewing wrote: If there's a link on the same web page that works when the user clicks on it, I don't think they're even going to notice the difference. They'll notice the difference when they want to redistribute Python, when they note the new licensing-based restrictions ("GMP must be in a

Re: [Python-3000] C API for ints and strings

2007-09-10 Thread Greg Ewing
Marcin 'Qrczak' Kowalczyk wrote: > The major technical problem with GMP is that an out of memory condition > during computation is a fatal error, GMP does not provide a way to > recover from it. If using GMP itself is not feasible, then perhaps some algorithms could be extracted from it in areas w

Re: [Python-3000] C API for ints and strings

2007-09-10 Thread Nicholas Bastin
On 9/10/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > Martin v. Löwis wrote: > > > The first right of the user is to get the source code > > easily, without having to beg for it. Only then it is also > > the user's right to modify it, and use the modified version > > in the application. > > Where doe

Re: [Python-3000] C API for ints and strings

2007-09-10 Thread Nicholas Bastin
On 9/10/07, Larry Hastings <[EMAIL PROTECTED]> wrote: > > Greg Ewing wrote: > If there's a link on the same web page that works > when the user clicks on it, I don't think they're > even going to notice the difference. > > They'll notice the difference when they want to redistribute Python, when

Re: [Python-3000] __format__ and datetime

2007-09-10 Thread Eric Smith
Paul Moore wrote: > I'd like to see the default format specified (somewhere). I note that > the default format for datetime values seems to differ for me (on > 3.0a1 on Windows) > > Python 3.0a1 (py3k:57844, Aug 31 2007, 16:54:27) [MSC v.1310 32 bit > (Intel)] on win32 > Type "help", "copyright",

Re: [Python-3000] __format__ and datetime

2007-09-10 Thread skip
Paul> The date and time defaults (which appear to be %Y-%m-%d and Paul> %H:%M:%s) seem perfectly acceptable, on the other hand. I would like to see an analog to %S which preserves fractions of a second as the default formatting for time and datetime objects does: >>> print(now) 2

Re: [Python-3000] __format__ and datetime

2007-09-10 Thread Guido van Rossum
Right. It's odd that there's nothing explicit that exactly produces the default. (Though floats have this issue too -- I wish it could be fixed there too.) On 9/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Paul> The date and time defaults (which appear to be %Y-%m-%d and > Paul>

Re: [Python-3000] patch: bytes object PyBUF_LOCKDATA read-only and immutable support

2007-09-10 Thread Guido van Rossum
I'd like to see Travis's response to this. It's setting a precedent regarding locking objects in read-only mode; I haven't found other examples of objects using LOCKDATA (the only mentions of it seem to be rejecting it :). I keep getting confused by the two separate lock counts (and I think in this

Re: [Python-3000] C API for ints and strings

2007-09-10 Thread Terry Reedy
"Nicholas Bastin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Yeah, my point was mostly an aside to anyone that might have | questioned my earlier results of a 2.3x slowdown on integer-sized | values because I used 1. A quick switch to 200 netted the exact same | results, Curr

Re: [Python-3000] C API for ints and strings

2007-09-10 Thread Nicholas Bastin
On 9/10/07, Terry Reedy <[EMAIL PROTECTED]> wrote: > > "Nicholas Bastin" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > | Yeah, my point was mostly an aside to anyone that might have > | questioned my earlier results of a 2.3x slowdown on integer-sized > | values because I used 1

Re: [Python-3000] patch: bytes object PyBUF_LOCKDATA read-only and immutable support

2007-09-10 Thread Travis E. Oliphant
Guido van Rossum wrote: > I'd like to see Travis's response to this. It's setting a precedent > regarding locking objects in read-only mode; I haven't found other > examples of objects using LOCKDATA (the only mentions of it seem to be > rejecting it :). I keep getting confused by the two separate

Re: [Python-3000] C API for ints and strings

2007-09-10 Thread Martin v. Löwis
>> The first right of the user is to get the source code >> easily, without having to beg for it. Only then it is also >> the user's right to modify it, and use the modified version >> in the application. > > Where does begging come into it? As long as the user > is provided with information which

Re: [Python-3000] C API for ints and strings

2007-09-10 Thread Martin v. Löwis
> If python.org agreed to host the GMP source, that would suffice for > all people distributing python binaries (they could then just refer to > the GMP source download as a link). It would not if they don't distribute the binary through download. If they put it on some media, or preinstalled on a

Re: [Python-3000] C API for ints and strings

2007-09-10 Thread Martin v. Löwis
> Interesting, I didn't look at the code (obviously), but my > understanding was that it was only positive integers below 100. See NSMALLPOSINTS and NSMALLNEGINTS. It's 257 positive ints since r42552, contributed through bugs.python.org/1436243. Regards, Martin ___

Re: [Python-3000] C API for ints and strings

2007-09-10 Thread Larry Hastings
Nicholas Bastin wrote: As for the user-replaceable shared library part, that's up for considerable debate. It's unlikely that static linkage legally creates a derivative work (that would be pretty unreasonable in computer science terms), but it's never been tested in court, so static linking wou