Re: [Python-3000] Immutable bytes type and bsddb or other IO

2007-08-23 Thread Guido van Rossum
On 8/23/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > It *does* implement that! So there's the solution: these APIs should > > not insist on bytes but use the buffer API. It's quite a bit of work I > > suspect (especially since you can't use PyArg_ParseTuple with y# any > > more) but worth i

Re: [Python-3000] Immutable bytes type and bsddb or other IO

2007-08-23 Thread Martin v. Löwis
> It *does* implement that! So there's the solution: these APIs should > not insist on bytes but use the buffer API. It's quite a bit of work I > suspect (especially since you can't use PyArg_ParseTuple with y# any > more) but worth it. I think there could be another code for PyArg_ParseTuple (or

Re: [Python-3000] Move to a "py3k" branch *DONE*

2007-08-23 Thread Guido van Rossum
That looks like a simple logic bug in the routine where the assert is failing (should return 1 when detecting None). I'll check in a fix momentarily. --Guido On 8/23/07, Collin Winter <[EMAIL PROTECTED]> wrote: > On 8/22/07, Gregory P. Smith <[EMAIL PROTECTED]> wrote: > > > > There are currently

Re: [Python-3000] uuid creation not thread-safe?

2007-08-23 Thread Guido van Rossum
This was now fixed in 3.0. Somebody might want to backport. On 7/28/07, lcaamano <[EMAIL PROTECTED]> wrote: > > On Jul 20, 1:52 pm, "Guido van Rossum" <[EMAIL PROTECTED]> wrote: > > I discovered what appears to be a thread-unsafety inuuid.py. This is > > in the trunk as well as in 3.x; I'm using t

Re: [Python-3000] Should 2to3 point out *possible*, but not definite changes?

2007-08-23 Thread Guido van Rossum
Yes, I think this would be way cool! I believe there are already a few fixers that print messages about things they know are wrong but don't know how to fix, those could also be integrated (although arguably you'd want those messages to be treated as more severe). Does this mean that Django is com

Re: [Python-3000] Immutable bytes type and bsddb or other IO

2007-08-23 Thread Guido van Rossum
On 8/23/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > Gregory P. Smith wrote: > > Wasn't a past mailing list thread claiming the bytes type was supposed > > to be great for IO? How's that possible unless we add a lock to the > > bytesobject? > > Doesn't the new buffer protocol provide something for

[Python-3000] sprint patch for server-side SSL

2007-08-23 Thread Bill Janssen
Here's the final form of the SSL patch. Now includes a test file. All bugs discovered on Wednesday have been fixed. Bill Index: Lib/socket.py === *** Lib/socket.py (revision 57372) --- Lib/socket.py (working copy) ***

Re: [Python-3000] make uuid.py creation threadsafe

2007-08-23 Thread Guido van Rossum
Thanks! Committed revision 57375. On 8/23/07, Yuri Ginsburg <[EMAIL PROTECTED]> wrote: > The attached small patch makes output buffer thus making uuid.py thread-safe. > > -- > Yuri Ginsburg (YG10) > > ___ > Python-3000 mailing list > Python-3000@python

Re: [Python-3000] String to unicode fixes in time and datetime

2007-08-23 Thread Guido van Rossum
Hi Ero, Thanks for these! I checked them in. The datetime patch had a few problems (did you run the unit test?) that I got rid of. The function you were looking for does exist, it's PyUnicode_AsUTF8String(). (which returns a new object instead of a borrowed reference). I changed your code to use

[Python-3000] [PATCH] Implement remaining rich comparison operations on dictviews

2007-08-23 Thread Keir Mierle
This patch implements rich comparisons with dict views such that dict().keys() can be compared like a set (i.e. < is subset, etc). Keir Index: Objects/dictobject.c === --- Objects/dictobject.c (revision 57367) +++ Objects/dictobject.c

[Python-3000] PEP 3101 implementation uploaded to the tracker.

2007-08-23 Thread Eric Smith
There are a handful of remaining issues, but it works for the most part. http://bugs.python.org/issue1009 Thanks to Guido and Talin for all of their help the last few days, and thanks to Patrick Maupin for help with the initial implementation. Known issues: Better error handling, per the PEP.

Re: [Python-3000] Immutable bytes type and bsddb or other IO

2007-08-23 Thread Greg Ewing
Gregory P. Smith wrote: > Wasn't a past mailing list thread claiming the bytes type was supposed > to be great for IO? How's that possible unless we add a lock to the > bytesobject? Doesn't the new buffer protocol provide something for getting a locked view of the data? If so, it seems like bytes

Re: [Python-3000] Is __cmp__ deprecated?

2007-08-23 Thread Greg Ewing
Guido van Rossum wrote: > cmp() is still alive and __cmp__ is used to overload it; on the one > hand I'd like to get rid of it but OTOH it's occasionally useful. Maybe you could keep cmp() but implement it in terms of, say, __lt__ and __eq__? -- Greg Ewing, Computer Science Dept, +--

[Python-3000] make uuid.py creation threadsafe

2007-08-23 Thread Yuri Ginsburg
The attached small patch makes output buffer thus making uuid.py thread-safe. -- Yuri Ginsburg (YG10) uuid.py.diff Description: Binary data ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubsc

[Python-3000] Should 2to3 point out *possible*, but not definite changes?

2007-08-23 Thread Adrian Holovaty
As part of the Python 3000 sprint (at Google's Chicago office), I've been working on the documentation for 2to3. I'm publishing updates at http://red-bean.com/~adrian/2to3.rst and will submit this as a documentation patch when it's completed. (I didn't get as much done today as I would have liked,

Re: [Python-3000] Strange method resolution problem with __trunc__, __round__ on floats

2007-08-23 Thread Guido van Rossum
I figured it out by stepping through builtin_trunc and into _PyType_Lookup for a bit. The type is not completely initialized; apparently fundamental types like float get initialized lazily *really* late. Inserting this block of code before the _PyType_Lookup call fixes things: if (Py_Type(

[Python-3000] String to unicode fixes in time and datetime

2007-08-23 Thread Ero Carrera
Hi, I'm attaching a small patch result of attempting to tackle part of one of the tasks in the Google Sprint. The patch removes most of the references of PyString_* calls in the "time" and "datetime" modules and adds Unicode support instead. There's a problem in "datetime" with "_PyUnico

Re: [Python-3000] [PATCH] Fix dumbdbm, which fixes test_shelve (for me); instrument other tests so we catch this sooner (and more directly)

2007-08-23 Thread Larry Hastings
Patch submitted to Roundup; it's issue #1007: http://bugs.python.org/issue1007 (It's listed under Python 2.6 as there's currently no appropriate choice in the "Versions" list.) /larry/ ___ Python-3000 mailing list Python-3000@python.org http://ma

[Python-3000] Strange method resolution problem with __trunc__, __round__ on floats

2007-08-23 Thread Keir Mierle
The newly introduced trunc() and round() have the following odd behavior: $ ./python Python 3.0x (py3k, Aug 23 2007, 17:15:22) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> trunc(3.14) Traceback (most recent call last): F

[Python-3000] [PATCH] Fix dumbdbm, which fixes test_shelve (for me); instrument other tests so we catch this sooner (and more directly)

2007-08-23 Thread Larry Hastings
Attached is a patch for review. As of revision 57341 (only a couple hours old as of this writing), test_shelve was failing on my machine. This was because I didn't have any swell databases available, so anydbm was falling back to dumbdbm, and dumbdbm had a bug. In Py3k, dumbdbm's dict-like

[Python-3000] [PATCH] Fix rich set comparison

2007-08-23 Thread Keir Mierle
This patch fixes rich set comparison so that x < y works when x is a set and y is something which implements the corresponding comparison. Keir Index: Objects/setobject.c === --- Objects/setobject.c (revision 57362) +++ Objects/setobj

Re: [Python-3000] [PATCH] Fix broken round and truncate behaviour (PEP3141)

2007-08-23 Thread Guido van Rossum
Alex and I did a bunch more work based on this patch and checked it in: Committed revision 57359. On 8/22/07, Keir Mierle <[EMAIL PROTECTED]> wrote: > This patch fixes the previously added truncate, and also fixes round > behavior. The two argument version of round is not currently handling > th

Re: [Python-3000] document processing tools conversion report

2007-08-23 Thread Georg Brandl
Paul Dubois schrieb: > FYI: docutils will require some modification of at least the io module, > to the extent that the ideal mode of fixing the current sources so that > a subsequent pass of 2to3 will do the job, is probably not possible (but > may be outside of this one file). I've made a report

[Python-3000] document processing tools conversion report

2007-08-23 Thread Paul Dubois
FYI: docutils will require some modification of at least the io module, to the extent that the ideal mode of fixing the current sources so that a subsequent pass of 2to3 will do the job, is probably not possible (but may be outside of this one file). I've made a report to the docutils tracker to th

Re: [Python-3000] Immutable bytes type and bsddb or other IO

2007-08-23 Thread Gregory P. Smith
On Thu, Aug 23, 2007 at 09:18:59PM +0200, "Martin v. L?wis" wrote: > > I -detest- the idea of making another temporary copy of the data just > > to allow the GIL to be released during IO. data copies == bad. > > Wasn't a past mailing list thread claiming the bytes type was supposed > > to be great

Re: [Python-3000] Immutable bytes type and bsddb or other IO

2007-08-23 Thread Martin v. Löwis
> I -detest- the idea of making another temporary copy of the data just > to allow the GIL to be released during IO. data copies == bad. > Wasn't a past mailing list thread claiming the bytes type was supposed > to be great for IO? How's that possible unless we add a lock to the > bytesobject? (

Re: [Python-3000] Move to a "py3k" branch *DONE*

2007-08-23 Thread Collin Winter
On 8/22/07, Gregory P. Smith <[EMAIL PROTECTED]> wrote: > > > There are currently about 7 failing unit tests left: > > > > > > test_bsddb > > > test_bsddb3 > ... > > fyi these two pass for me on the current py3k branch on ubuntu linux > and mac os x 10.4.9. test_bsddb works for me on Ubuntu, and t

Re: [Python-3000] Move to a "py3k" branch *DONE*

2007-08-23 Thread Georg Brandl
Bill Janssen schrieb: >> I plan to spend some Real Time on those today and I think Bill is >> going to meet up with me on #python-dev when the Californians wake up. > > That's not working real well right now... IRC seems wedged for me. > > Probably a firewall issue. > > I've got to try a diffe

Re: [Python-3000] Move to a "py3k" branch *DONE*

2007-08-23 Thread Bill Janssen
> I plan to spend some Real Time on those today and I think Bill is > going to meet up with me on #python-dev when the Californians wake up. That's not working real well right now... IRC seems wedged for me. Probably a firewall issue. I've got to try a different location, and we'll try to conn

Re: [Python-3000] Immutable bytes type and bsddb or other IO

2007-08-23 Thread Gregory P. Smith
On Thu, Aug 23, 2007 at 09:49:19AM +0200, "Martin v. L?wis" wrote: > > Yeah you did the keys (good!). I just checked in a change to require > > values to also by bytes. Maybe that goes so far as to be inconvenient? > > Ah, ok. I think it is fine. We still need to discuss what the best > way is t

Re: [Python-3000] Updated and simplified PEP 3141: A Type Hierarchy for Numbers

2007-08-23 Thread Paul Moore
On 22/08/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > * Add Demo/classes/Rat.py to the stdlib? > > Yes, but it needs a makeover. At the very least I'd propose the module > name to be rational. If no-one else gets to this, I might take a look. But I'm not likely to make fast progress as I do

Re: [Python-3000] Is __cmp__ deprecated?

2007-08-23 Thread Paul Moore
On 23/08/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Coerce is definitely dead. > > cmp() is still alive and __cmp__ is used to overload it; on the one > hand I'd like to get rid of it but OTOH it's occasionally useful. So > it'll probably stay. However, to overload <, == etc. you *have* to >

Re: [Python-3000] Is __cmp__ deprecated?

2007-08-23 Thread Guido van Rossum
Coerce is definitely dead. cmp() is still alive and __cmp__ is used to overload it; on the one hand I'd like to get rid of it but OTOH it's occasionally useful. So it'll probably stay. However, to overload <, == etc. you *have* to overload __lt__ and friends. On 8/23/07, Paul Moore <[EMAIL PROTEC

[Python-3000] Is __cmp__ deprecated?

2007-08-23 Thread Paul Moore
Can I just check - is __cmp__ due for removal in Py3K? There's no mention of it in PEP 3100, but its status seems unclear from references I've found. Actually, is __coerce__ still around, as well? Again, I can't see a clear answer in the PEPs or list discussions. Paul. ___

Re: [Python-3000] [PATCH] Fix math.ceil() behaviour for PEP3141

2007-08-23 Thread Guido van Rossum
Aahz, While the sprint is going on (and because I knew about the tracker move) I've encouraged people at the sprint to post their patches directly to python-3000 -- most likely the review feedback will be given in person and then the patch will be checked in. This is quicker than using a tracker f

Re: [Python-3000] proposed fix for test_xmlrpc.py in py3k

2007-08-23 Thread Jeremy Hylton
On 8/22/07, John Reese <[EMAIL PROTECTED]> wrote: > Good afternoon. I'm in the Google Python Sprint working on getting > the test_xmlrpc unittest to pass. The following patch was prepared by > Jacques Frechet and me. We'd appreciate feedback on the attached > patch. > > What was broken: > > > 1.

Re: [Python-3000] [PATCH] Fix math.ceil() behaviour for PEP3141

2007-08-23 Thread Aahz
On Wed, Aug 22, 2007, Keir Mierle wrote: > > The attached patch fixes math.ceil to delegate to x.__ceil__() if it > is defined, according to PEP 3141, and adds tests to cover the new > cases. Patch is against r57303. Please wait until the new python.org bug tracker is up and post the patch there.

Re: [Python-3000] Move to a "py3k" branch *DONE*

2007-08-23 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Aug 22, 2007, at 10:06 PM, Guido van Rossum wrote: > For me too. Great work whoever fixed these (and other tests, like > xmlrpc). > > All I've got left failing is the three email tests, and I know Barry > Warsaw is working on those. (Although he

Re: [Python-3000] Immutable bytes type and dbm modules

2007-08-23 Thread Martin v. Löwis
> Yeah you did the keys (good!). I just checked in a change to require > values to also by bytes. Maybe that goes so far as to be inconvenient? Ah, ok. I think it is fine. We still need to discuss what the best way is to do string:string databases, or string:bytes databases. I added StringKeys

Re: [Python-3000] Immutable bytes type and dbm modules

2007-08-23 Thread Gregory P. Smith
On Thu, Aug 23, 2007 at 07:58:33AM +0200, "Martin v. L?wis" wrote: > > IMHO all of that is desirable in many situations but it is not strict. > > bytes:bytes or int:bytes (depending on the database type) are > > fundamentally all the C berkeleydb library knows. Attaching meaning > > to the keys an

Re: [Python-3000] easy int to bytes conversion similar to chr?

2007-08-23 Thread Martin v. Löwis
Gregory P. Smith schrieb: > Is there anything similar to chr(65) for creating a single byte string > that doesn't involve creating an intermediate string or tuple object? > > bytes(chr(65)) > bytes((65,)) > > both seem slightly weird. b = bytes(1) b[0] = 65 doesn't create an intermediate stri