Re: [Python-Dev] Type of range object members

2006-08-15 Thread Neal Norwitz

On 8/15/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:


That penalty is already paid today. Much code dealing with
ints has a type test whether it's an int or a long. If
int and long become subtypes of each other or of some abstract
type, performance will decrease even more because a subtype
test is quite expensive if the object is neither int nor
long (it has to traverse the entire base type hierarchy to
find out its not inherited from int).


I was playing around with a little patch to avoid that penalty.  It
doesn't take any additional memory, just a handful of bits we aren't
using. :-)

For the more common builtin types, it stores whether it's a subclass
in tp_flags, so there's no function call necessary and it's a constant
time operation.  It was faster when doing simple stuff.  Haven't
thought much whether this is really worthwhile or not.

n
Index: Include/stringobject.h
===
--- Include/stringobject.h	(revision 51237)
+++ Include/stringobject.h	(working copy)
@@ -55,8 +55,9 @@
 PyAPI_DATA(PyTypeObject) PyBaseString_Type;
 PyAPI_DATA(PyTypeObject) PyString_Type;
 
-#define PyString_Check(op) PyObject_TypeCheck(op, &PyString_Type)
 #define PyString_CheckExact(op) ((op)->ob_type == &PyString_Type)
+#define PyString_Check(op) (PyString_CheckExact(op) || \
+ PyType_FastSubclass((op)->ob_type, Py_TPFLAGS_STRING_SUBCLASS))
 
 PyAPI_FUNC(PyObject *) PyString_FromStringAndSize(const char *, Py_ssize_t);
 PyAPI_FUNC(PyObject *) PyString_FromString(const char *);
Index: Include/dictobject.h
===
--- Include/dictobject.h	(revision 51237)
+++ Include/dictobject.h	(working copy)
@@ -90,8 +90,9 @@
 
 PyAPI_DATA(PyTypeObject) PyDict_Type;
 
-#define PyDict_Check(op) PyObject_TypeCheck(op, &PyDict_Type)
 #define PyDict_CheckExact(op) ((op)->ob_type == &PyDict_Type)
+#define PyDict_Check(op) (PyDict_CheckExact(op) || \
+ PyType_FastSubclass((op)->ob_type, Py_TPFLAGS_DICT_SUBCLASS))
 
 PyAPI_FUNC(PyObject *) PyDict_New(void);
 PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key);
Index: Include/unicodeobject.h
===
--- Include/unicodeobject.h	(revision 51237)
+++ Include/unicodeobject.h	(working copy)
@@ -390,8 +390,9 @@
 
 PyAPI_DATA(PyTypeObject) PyUnicode_Type;
 
-#define PyUnicode_Check(op) PyObject_TypeCheck(op, &PyUnicode_Type)
 #define PyUnicode_CheckExact(op) ((op)->ob_type == &PyUnicode_Type)
+#define PyUnicode_Check(op) (PyUnicode_CheckExact(op) || \
+ PyType_FastSubclass((op)->ob_type, Py_TPFLAGS_UNICODE_SUBCLASS))
 
 /* Fast access macros */
 #define PyUnicode_GET_SIZE(op) \
Index: Include/intobject.h
===
--- Include/intobject.h	(revision 51237)
+++ Include/intobject.h	(working copy)
@@ -27,8 +27,9 @@
 
 PyAPI_DATA(PyTypeObject) PyInt_Type;
 
-#define PyInt_Check(op) PyObject_TypeCheck(op, &PyInt_Type)
 #define PyInt_CheckExact(op) ((op)->ob_type == &PyInt_Type)
+#define PyInt_Check(op) (PyInt_CheckExact(op) || \
+		 PyType_FastSubclass((op)->ob_type, Py_TPFLAGS_INT_SUBCLASS))
 
 PyAPI_FUNC(PyObject *) PyInt_FromString(char*, char**, int);
 #ifdef Py_USING_UNICODE
Index: Include/listobject.h
===
--- Include/listobject.h	(revision 51237)
+++ Include/listobject.h	(working copy)
@@ -40,8 +40,9 @@
 
 PyAPI_DATA(PyTypeObject) PyList_Type;
 
-#define PyList_Check(op) PyObject_TypeCheck(op, &PyList_Type)
 #define PyList_CheckExact(op) ((op)->ob_type == &PyList_Type)
+#define PyList_Check(op) (PyList_CheckExact(op) || \
+		PyType_FastSubclass((op)->ob_type, Py_TPFLAGS_LIST_SUBCLASS))
 
 PyAPI_FUNC(PyObject *) PyList_New(Py_ssize_t size);
 PyAPI_FUNC(Py_ssize_t) PyList_Size(PyObject *);
Index: Include/object.h
===
--- Include/object.h	(revision 51237)
+++ Include/object.h	(working copy)
@@ -517,6 +517,18 @@
 /* Objects support nb_index in PyNumberMethods */
 #define Py_TPFLAGS_HAVE_INDEX (1L<<17)
 
+/* These flags are used to determine if a type is a subclass. */
+/* Uses bits 30-27. */
+#define Py_TPFLAGS_FAST_SUBCLASS_MASK (0x7800)
+#define Py_TPFLAGS_FAST_SUBCLASS (1L<<27)
+#define Py_TPFLAGS_INT_SUBCLASS		(Py_TPFLAGS_FAST_SUBCLASS | 0x7000)
+#define Py_TPFLAGS_LONG_SUBCLASS	(Py_TPFLAGS_FAST_SUBCLASS | 0x6000)
+#define Py_TPFLAGS_LIST_SUBCLASS	(Py_TPFLAGS_FAST_SUBCLASS | 0x5000)
+#define Py_TPFLAGS_TUPLE_SUBCLASS	(Py_TPFLAGS_FAST_SUBCLASS | 0x4000)
+#define Py_TPFLAGS_STRING_SUBCLASS	(Py_TPFLAGS_FAST_SUBCLASS | 0x3000)
+#define Py_TPFLAGS_UNICODE_SUBCLASS	(Py_TPFLAGS_FAST_SUBCLASS | 0x2000)
+#define Py_TPFLAGS_DICT_SUBCLASS	(Py_TPFLAGS_FAST_SUBCLASS | 0x1000)
+
 #define Py_TPFLAGS_DEFAULT  ( \
  Py_TPFLAGS_HAVE_GE

Re: [Python-Dev] Type of range object members

2006-08-15 Thread Martin v. Löwis
Greg Ewing schrieb:
>> There isn't? Actually a lot of APIs currently assumen that.
> 
> Also it means you'd pay a penalty every time you
> access it, whereas presumably short ints are the
> case we want to optimise for speed as well.

That penalty is already paid today. Much code dealing with
ints has a type test whether it's an int or a long. If
int and long become subtypes of each other or of some abstract
type, performance will decrease even more because a subtype
test is quite expensive if the object is neither int nor
long (it has to traverse the entire base type hierarchy to
find out its not inherited from int).

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Martin v. Löwis
Greg Ewing schrieb:
> Guido van Rossum wrote:
>> I worry that dropping the special allocator will be too slow.
> 
> Surely there's some compromise that would allow
> recently-used ints to be kept around, but reclaimed
> if memory becomes low?

Hardly. The efficiency of the special-case allocator also
comes from the fact that it doesn't ever have to release
memory. Just try changing it to see what I mean.

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Martin v. Löwis
Greg Ewing schrieb:
> Martin v. Löwis wrote:
>> We had this discussion before; if you use ob_size==0 to indicate
>> that it's an int, this space isn't needed in a long int.
> 
> What about int subclasses?

It's what Guido proposes.

It would still leave two types (perhaps three) at the C level,
so C code might have to continue making conditional code depending
on which of these it is. Also, Python code that dispatches by type
still needs to make the distinction.

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Tim Peters
[Greg Ewing]
> Surely there's some compromise that would allow
> recently-used ints to be kept around, but reclaimed
> if memory becomes low?

Not without losing /something/ we currently enjoy.  The current int
scheme has theoretically optimal memory use too, consuming 12 bytes
per int object on a 32-bit box.  That's minimal, because the object's
type pointer, refcount, and integer value each require 4 bytes on a
32-bit box.

It does this by allocating "big blocks" and carving them into 12-byte
slices itself.  But as with any "big block" scheme, a live integer
anywhere in a block prevents the entire block from being freed, and
objects can't /move/ in CPython either (so, e.g., if a single live
integer is keeping a big block alive, we can't move it into some other
block).  That's the same kind of problem obmalloc has with its "very
big block" arenas, and for which only heuristic help was added (with
considerable increase in complexity) for 2.5 (before 2.5, obmalloc
never freed an arena, same as ints and floats never free their
versions of big blocks).
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] uuid module - byte order issue

2006-08-15 Thread Oren Tirosh
On 04/08/06, Ka-Ping Yee <[EMAIL PROTECTED]> wrote:
> On Thu, 3 Aug 2006, Oren Tirosh wrote:
> > The UUID module uses network byte order, regardless of the platform
> > byte order. On little-endian platforms like Windows the ".bytes"
> > property of UUID objects is not compatible with the memory layout
>
> RFC 4122 says:
>
> In the absence of explicit application or presentation protocol
> specification to the contrary, a UUID is encoded as a 128-bit
> object, as follows:
>
> The fields are encoded as 16 octets, with the sizes and order of
> the fields defined above, and with each field encoded with the
> Most Significant Byte first (known as network byte order).

RFC 4122 defines a canonical byte order for UUIDs but also makes
explicit reference to the fact that UUIDs are stored locally in native
byte order. The final step in the RFC 4122 UUID generation algorithm
is:

>   o  Convert the resulting UUID to local byte order.

So this is not another case of the
Microsoft-implements-RFC-incorrectly syndrome. After all, they are one
of the co-authors of the document.

Compatibility with Windows "GUIDs" may be one of the most important
use cases for the UUID module. It's important to resolve this or users
will have unpleasant surprises. I did.

alternatives:

1. Default is big endian byte order. Little endian is explicit.
2. Default is native byte order. Little endian and big endian are explicit.
3. No default. Little endian and big endian are both explicit.

All three are relevant for both the constructor and retrieving the
byte representation.

  Oren
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Dicts are broken Was: unicode hell/mixing str and unicode asdictionarykeys

2006-08-15 Thread mal
Martin v. Löwis wrote:
> M.-A. Lemburg schrieb:
>> Python just doesn't know the encoding of the 8-bit string, so can't
>> make any assumptions on it. As result, it raises an exception to inform
>> the programmer.
> 
> Oh, Python does make an assumption what the encoding is: it assumes
> it is the system encoding (i.e. "ascii"). Then invoking the ascii
> codec raises an exception, because the string clearly isn't ascii.

Right, and as consequence, Python raises an exception to let the
programmer correct the problem.

The subsequent solution to the problem may result in the
string being decoded into Unicode and the two resulting Unicode
objects being unequal, or it may also result in them being equal.
Python doesn't have this knowledge, so always returning false
is clearly wrong.

Hiding programmer errors is not making life easier in the
long run, so I'm -1 on having the equality comparison return
False.

Instead we should generate a warning in Python 2.5 and introduce
the exception in Python 2.6.

>> Note that you do have to interpret the string as characters
>> > if you compare it to Unicode and there's nothing wrong with
>> > that.
> 
> Consider this:
> py> int(3+4j)
> Traceback (most recent call last):
>   File "", line 1, in ?
> TypeError: can't convert complex to int; use int(abs(z))
> py> 3 == 3+4j
> False
>
> So even though the conversion raises an exception, the
> values are determined to be not equal. Again, because int
> is a nearly true subset of complex, the conversion goes
> the other way, but *if* it would use the complex->int
> conversion, then the TypeError should be taken as
> a guarantee that the objects don't compare equal.

In the above example, you clearly know that the two are
unequal due to the relationship between complex numbers
having an imaginary part and integers..

The same is true for the overflow case:

>>> 2**1 == 1.23
False
>>> float(2**1)
Traceback (most recent call last):
  File "", line 1, in ?
OverflowError: long int too large to convert to float

(Note that in Python 2.3 this used to raise an exception as well.)

However, this is not the case for 8-bit string vs. Unicode,
since you cannot use such extra knowledge if you find that ASCII
encoding assumption obviously doesn't match the string
in question.

> Expanding this view to Unicode should mean that a unicode
> string U equals a byte string B if
> U.encode(system_encode) == B or B.decode(system_encoding) == U,
> and that they don't equal otherwise 

Agreed.

Note that Python always coerces to the "bigger" type. As a result,
the second option is what is actually implemented in Python.

> (e.g. if the conversion
> fails with a "not convertible" exception). 

I disagree with this part.

Failure to decode a string doesn't imply inequality. It implies
that the programmer needs to step in and correct the problem by
making an explicit and conscious decision.

The alternative would be to decide that equal comparisons should never
be allowed to raise exceptions and instead have the equal comparison
return False. In which case, we'd have the revert the dict patch
altogether and instead silence all exceptions that
are generated during the equal comparison (not only in the dict
implementation), replacing them with a False return value.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 07 2006)
>>> Python/Zope Consulting and Support ...http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/


::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! 

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Four issue trackers submitted for Infrastructue Committee's tracker search

2006-08-15 Thread Brett Cannon
Back in June, the Python Software Foundation's Infrastructure Committee asked for help in the search for a new issue tracker to replace SourceForge (see http://wiki.python.org/moin/CallForTrackers
 for details). We asked people who wished to help with the search to install their favourite issue tracker and import a data dump of our issues from SourceForge. We placed a deadline of August 7th to have the installation up and going. We realized that this was a large request to make of the community, but we needed to make sure that we got to evaluate any candidate trackers with the amount of issues that Python has so as to get a real-world feel.
Not surprisingly, the community stepped up to the challenge with four different test tracker installations by the deadline! We have one for JIRA, Roundup, Trac, and Launchpad. The current schedule calls for the Infrastructure Committee to spend the next month evaluating the four trackers and making a decision on which one to go with. This might slip, though, since this overlaps with traditional American and European vacation time. But the slippage will not go beyond October 1.
On behalf of the Infrastructure committee I thank the people who took the time and effort to set up a test tracker to help improve the development of Python.- Brett Cannon  Chairman, PSF Infrastructure Committee
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] IDLE patches - bugfix or not?

2006-08-15 Thread Kurt B. Kaiser
Anthony Baxter <[EMAIL PROTECTED]> writes:

> On Wednesday 16 August 2006 06:19, Jim Jewett wrote:
>> I just uploaded a series of IDLE patches, but I'm not quite sure how
>> to classify them on the feature/bugfix scale now that the last beta is
>> out.
>>
>> >From most to least buggish:
>>
>> python.org/sf/1540892 -- honor the new quit() behavior.  On the other
>> hand, it was documented that this didn't work in IDLE, and it is
>> *possible* that someone was counting on this.
>
> This seems like a sensible thing to add.
>
>> python.org/sf/1540851 -- with is now a blockopener, and should be
>> counted as such -- I *think* this one would be safe, but I know that
>> changing a parser can be surprising, and I suppose it *could* wait
>> until with no longer requires a future statement.
>
> If this can be done safely, it should be done. Preferably before RC1, so that 
> we have time to fix any issues it shows up.

I will look at these two.  RC1 seems reasonable.

>> python.org/sf/1540874 -- broken shortcut keys.  On windows, only one
>> entry per menu can be reached with the same shortcut letter, so
>> advertising others is just an attractive nuisance.  I'm not sure that
>> other systems wouldn't be able to use the hidden shortcuts.
>
> Tough call. I guess it depends on the other systems - I will try this on 
> Linux 
> at least, and see if it works there. If it's broken everywhere, then changing 
> it would seem the least offensive choice.

I would have been inclined to make the other choice, i.e. 'p' as the
hotkey for print, rather than the rarely used "save copy as".

>> python.org/sf/1540869 -- GUI fix.  The current code puts in a
>> separator using a magic number (and has XXX comments about it.)  This
>> changes the magic number so that the separator is more visible, but
>> I'm not sure the old behavior rose to a bug, or that it wasn't
>> platform dependent.
>
> Let's leave this one for 2.6.
>
>> python.org/sf/1540849 -- except too broad.  I wouldn't suggest
>> applying this late in the release cycle, except that it seems sort of
>> like the memory errors that are still being patched.
>
> I'd be concerned that this might cause other obscure behaviour changes, and 
> so 
> I'd prefer to leave this to 2.6.

Yes, 2.6 for these two.

-- 
KBK
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread Kurt B. Kaiser
Anthony Baxter <[EMAIL PROTECTED]> writes:

> I'd also like to see idle's separate version number go away and have
> it start using the Python version number - maybe as of 2.6?

+1

When we merged IDLEfork the consensus was to keep the versioning
separate.  But it seems confusing and is extra work for the release
managers.

> This would then also mean we could pull idle's separate NEWS file into
> the master NEWS file. Right now, the "release notes" on the webpage
> miss all IDLE release notes, since it's just the main NEWS file.

-1

Right now IDLE has a button in the "About IDLE" dialog which accesses
the IDLE NEWS.txt file, and another which accesses Python's NEWS.
IDLE users may not want to grovel through all the Python changes to
find out what changed in the IDE.

It would be nice if the key IDLE changes could make it to the "What's New
in Python X.X".  If Andrew is interested, I could draft something for him.

-- 
KBK
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] TRUNK FREEZE for 2.5c1, 00:00 UTC, Thursday 17th August

2006-08-15 Thread Anthony Baxter
Ok, here we go... I'm declaring the TRUNK FROZEN as of 00:00 UTC on Thursday 
the 17th of August. This is in about 22 hours time. At this time, I'll be 
cutting the release25-maint branch and 2.5c1 (and all future 2.5 releases) 
will be from that branch. I'll send another email once the release is done - 
at that point, the trunk is then available for 2.6 checkins. 

Anthony
-- 
Anthony Baxter <[EMAIL PROTECTED]>
It's never too late to have a happy childhood.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] IDLE patches - bugfix or not?

2006-08-15 Thread Anthony Baxter
On Wednesday 16 August 2006 06:19, Jim Jewett wrote:
> I just uploaded a series of IDLE patches, but I'm not quite sure how
> to classify them on the feature/bugfix scale now that the last beta is
> out.
>
> >From most to least buggish:
>
> python.org/sf/1540892 -- honor the new quit() behavior.  On the other
> hand, it was documented that this didn't work in IDLE, and it is
> *possible* that someone was counting on this.

This seems like a sensible thing to add.

> python.org/sf/1540851 -- with is now a blockopener, and should be
> counted as such -- I *think* this one would be safe, but I know that
> changing a parser can be surprising, and I suppose it *could* wait
> until with no longer requires a future statement.

If this can be done safely, it should be done. Preferably before RC1, so that 
we have time to fix any issues it shows up.

> python.org/sf/1540874 -- broken shortcut keys.  On windows, only one
> entry per menu can be reached with the same shortcut letter, so
> advertising others is just an attractive nuisance.  I'm not sure that
> other systems wouldn't be able to use the hidden shortcuts.

Tough call. I guess it depends on the other systems - I will try this on Linux 
at least, and see if it works there. If it's broken everywhere, then changing 
it would seem the least offensive choice.

> python.org/sf/1540869 -- GUI fix.  The current code puts in a
> separator using a magic number (and has XXX comments about it.)  This
> changes the magic number so that the separator is more visible, but
> I'm not sure the old behavior rose to a bug, or that it wasn't
> platform dependent.

Let's leave this one for 2.6.

> python.org/sf/1540849 -- except too broad.  I wouldn't suggest
> applying this late in the release cycle, except that it seems sort of
> like the memory errors that are still being patched.

I'd be concerned that this might cause other obscure behaviour changes, and so 
I'd prefer to leave this to 2.6.


Anthony
-- 
Anthony Baxter <[EMAIL PROTECTED]>
It's never too late to have a happy childhood.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread Anthony Baxter
On Tuesday 15 August 2006 22:57, Thomas Heller wrote:
> What is the policy for documentation changes?  Am I allowed to check in
> changes/additions to the ctypes docs without release manager permission
> after the release candidate is out?  I'l always make sure that the html
> docs can be built.

So long as you don't break anything, doc changes are fine. Remember that post 
RC1 you'll need to checkin to both release25-maint and trunk.

Anthony

-- 
Anthony Baxter <[EMAIL PROTECTED]>
It's never too late to have a happy childhood.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Greg Ewing
Guido van Rossum wrote:

> On 8/15/06, James Y Knight <[EMAIL PROTECTED]> wrote:
 >
>>There's no particular reason that a short int must be able to store
>>the entire range of C "long", so, as many bits can be stolen from it
>>as desired.
> 
> There isn't? Actually a lot of APIs currently assumen that.

Also it means you'd pay a penalty every time you
access it, whereas presumably short ints are the
case we want to optimise for speed as well.

--
Greg

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread Anthony Baxter
I really don't care any more about this. My initial concern (and why I 
requested the change) was that there are no more official separate distutils 
releases. I don't see how keeping a bunch of version numbers in the stdlib 
that just track the main version number is a sane use of developer time - 
particularly when it's only being used for someone's private releases. If 
you're cutting releases out of the stdlib, it seems to me that the 
maintenance load should be on you (where 'you' is 'anyone doing something 
like this', not MAL specifically )

I'd also like to see idle's separate version number go away and have it start 
using the Python version number - maybe as of 2.6? This would then also mean 
we could pull idle's separate NEWS file into the master NEWS file. Right now, 
the "release notes" on the webpage miss all IDLE release notes, since it's 
just the main NEWS file.

Since it's provoked so many complaints, change it back if you want. I won't be 
bothering to check that it's correct from now on, nor will I be updating it. 
Any user complaints will be ignored, and an incorrect version number will not 
be considered a reason for a bugfix release.

Anthony
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Greg Ewing
Guido van Rossum wrote:
> I worry that dropping the special allocator will be too slow.

Surely there's some compromise that would allow
recently-used ints to be kept around, but reclaimed
if memory becomes low?

--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Greg Ewing
Martin v. Löwis wrote:
> We had this discussion before; if you use ob_size==0 to indicate
> that it's an int, this space isn't needed in a long int.

What about int subclasses?

--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Guido van Rossum
On 8/15/06, James Y Knight <[EMAIL PROTECTED]> wrote:
> On Aug 15, 2006, at 7:06 PM, Guido van Rossum wrote:
> >> There's no particular reason that a short int must be able to store
> >> the entire range of C "long", so, as many bits can be stolen from it
> >> as desired.
> >
> > There isn't? Actually a lot of APIs currently assumen that.
>
> I thought we were talking about Py3k. *IF* the idea is to integrate
> both short/long ints into a single type, with only an internal
> distinction (which is what is being discussed), all those APIs are
> broken already. The particular internal division of the new int
> object between short and long doesn't matter. Which is all I was saying.
>
> If combining all integers into a single type isn't actually desired,
> then neither my message nor Martin's is relevant.

As I said before, at the C level I expect the distinction between int
and long to be alive and well. Changing it so that ints don't have the
full range of the corresponding C type would be painful IMO.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread Neil Schemenauer
Neal Norwitz <[EMAIL PROTECTED]> wrote:
> I don't know of any.  I haven't heard of any issues with the fixes
> that have been checked in.

It would be nice if someone could bytecompile Lib using
Tools/compiler/compile.py and then run the test suite.  I'd do it
myself but can't spare the time at the moment (I started but ran
into what seems to be a gcc bug along the way).

  Neil

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread James Y Knight
On Aug 15, 2006, at 7:06 PM, Guido van Rossum wrote:
>> There's no particular reason that a short int must be able to store
>> the entire range of C "long", so, as many bits can be stolen from it
>> as desired.
>
> There isn't? Actually a lot of APIs currently assumen that.

I thought we were talking about Py3k. *IF* the idea is to integrate  
both short/long ints into a single type, with only an internal  
distinction (which is what is being discussed), all those APIs are  
broken already. The particular internal division of the new int  
object between short and long doesn't matter. Which is all I was saying.

If combining all integers into a single type isn't actually desired,  
then neither my message nor Martin's is relevant.

James
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Guido van Rossum
On 8/15/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> James Y Knight schrieb:
> > But it's the short int that you probably really want to make size
> > efficient.
>
> Only if you have many of them. And if you do, you have the problem
> of the special-cased allocator: when the many ints go away, Python
> will hold onto their memory forever.

But that's a bit of a corner case. There are plenty of cases where
ints are allocated and deallocated at a fast rate without allocating
tons of them at once, or where there's no need to reuse the same
memory for something else later. I wonder if we could have a smarter
int allocator that allocates some ints in a special array but switches
to the standard allocator if too many are being allocated?

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Martin v. Löwis
James Y Knight schrieb:
> But it's the short int that you probably really want to make size  
> efficient.

Only if you have many of them. And if you do, you have the problem
of the special-cased allocator: when the many ints go away, Python
will hold onto their memory forever.

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Guido van Rossum
On 8/15/06, James Y Knight <[EMAIL PROTECTED]> wrote:
>
> On Aug 15, 2006, at 6:20 PM, Martin v. Löwis wrote:
> > Guido van Rossum schrieb:
> >> From the Python *user*'s perspective, yes, as much as possible. But
> >> I'm still playing with the thought of having two implementation
> >> types,
> >> since otherwise we'd have to devote 4 bytes (8 on a 64-bit platform)
> >> to the single *bit* telling the difference between the two internal
> >> representations.
> >
> > We had this discussion before; if you use ob_size==0 to indicate
> > that it's an int, this space isn't needed in a long int. On a 32-bit
> > platform, the size of an int would go up from 12 to 16; if we stop
> > using a special-cased allocator (which we should (*)), there isn't
> > any space increase on such a platform. On a 64-bit platform, the
> > size of an int would go up from 24 bytes to 32 bytes.
>
> But it's the short int that you probably really want to make size
> efficient. Which is of course also doable via something like:
>
> typedef struct {
>  PyObject_HEAD
>  long ob_islong : 1;
>  long ob_ival_or_size : LONG_BITS - 1;
>  long ob_digit[0];
> } PyIntObject;
>
> There's no particular reason that a short int must be able to store
> the entire range of C "long", so, as many bits can be stolen from it
> as desired.

There isn't? Actually a lot of APIs currently assumen that.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread M.-A. Lemburg
Martin v. Löwis wrote:
> M.-A. Lemburg schrieb:
>>> It's either an official feature, with somebody maintaining it,
>>> or people should expect to break it anytime.
>> I'll let you know when things break - is that good enough ?
> 
> That can't be an official policy; you seem to define "breaks"
> as "breaks in my (your) personal usage of distutils". While
> this is fine as an end-user point of view, it isn't useful
> as a maintenance guideline.

It's all I can offer.

We do use quite a few distutils
features and also extend it in various ways, so I suppose
that our build system covers quite a bit of what distutils
has to offer. Think of it as a test-bot that runs a real-life
test on the distutils code.

> In case you don't see what I mean: I said that something
> is already broken (bdist_msi), where "broken" means
> "doesn't work", and you said "it's only a small part".
> So if it's fine that only small parts break, I wonder
> where this gets us over time.

distutils is composed of many components. bdist_msi is
one of them. Because it's new it can hardly "break"
distutils in any way because it's a feature that didn't
exist in the distutils version shipped with
Python prior to 2.5.

As a result, that distribution format cannot be used with
older Python versions, but the rest of distutils continues
to work as usual.

I wouldn't call that breakage of distutils. It's just a
feature that has external requirements, much like you
can't run bdist_rpm without having the RPM tool installed.

In general, if you have to rely on new features in Python
such as extension modules which are not available in older
Python versions, then that's fine - but again, if not
really necessary, I'd rather see an approach being used
that also works with older Python versions.

What I do consider breakage, is if you use Python 2.5
features just to beef up some part of distutils core
code.

> For another example, you found that 2.1 compatibility is
> now broken (due to usage of True and False). When distutils
> was still listed in PEP 291, 2.1 compatibility was mentioned
> as a goal. Now, it doesn't seem to bother you very much
> that 2.1 compatibility is gone.

Actually, it does bother me, but I understand that not
many people use Python 2.1 anymore, so don't insist keeping
that version requirement.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 16 2006)
>>> Python/Zope Consulting and Support ...http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/


::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! 
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread James Y Knight

On Aug 15, 2006, at 6:20 PM, Martin v. Löwis wrote:
> Guido van Rossum schrieb:
>> From the Python *user*'s perspective, yes, as much as possible. But
>> I'm still playing with the thought of having two implementation  
>> types,
>> since otherwise we'd have to devote 4 bytes (8 on a 64-bit platform)
>> to the single *bit* telling the difference between the two internal
>> representations.
>
> We had this discussion before; if you use ob_size==0 to indicate
> that it's an int, this space isn't needed in a long int. On a 32-bit
> platform, the size of an int would go up from 12 to 16; if we stop
> using a special-cased allocator (which we should (*)), there isn't
> any space increase on such a platform. On a 64-bit platform, the
> size of an int would go up from 24 bytes to 32 bytes.

But it's the short int that you probably really want to make size  
efficient. Which is of course also doable via something like:

typedef struct {
 PyObject_HEAD
 long ob_islong : 1;
 long ob_ival_or_size : LONG_BITS - 1;
 long ob_digit[0];
} PyIntObject;

There's no particular reason that a short int must be able to store  
the entire range of C "long", so, as many bits can be stolen from it  
as desired.

James
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread Martin v. Löwis
M.-A. Lemburg schrieb:
>> It's either an official feature, with somebody maintaining it,
>> or people should expect to break it anytime.
> 
> I'll let you know when things break - is that good enough ?

That can't be an official policy; you seem to define "breaks"
as "breaks in my (your) personal usage of distutils". While
this is fine as an end-user point of view, it isn't useful
as a maintenance guideline.

In case you don't see what I mean: I said that something
is already broken (bdist_msi), where "broken" means
"doesn't work", and you said "it's only a small part".
So if it's fine that only small parts break, I wonder
where this gets us over time.

For another example, you found that 2.1 compatibility is
now broken (due to usage of True and False). When distutils
was still listed in PEP 291, 2.1 compatibility was mentioned
as a goal. Now, it doesn't seem to bother you very much
that 2.1 compatibility is gone.

Regards,
Martin

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Guido van Rossum
On 8/15/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> Guido van Rossum schrieb:
> > From the Python *user*'s perspective, yes, as much as possible. But
> > I'm still playing with the thought of having two implementation types,
> > since otherwise we'd have to devote 4 bytes (8 on a 64-bit platform)
> > to the single *bit* telling the difference between the two internal
> > representations.
>
> We had this discussion before; if you use ob_size==0 to indicate
> that it's an int, this space isn't needed in a long int. On a 32-bit
> platform, the size of an int would go up from 12 to 16; if we stop
> using a special-cased allocator (which we should (*)), there isn't
> any space increase on such a platform. On a 64-bit platform, the
> size of an int would go up from 24 bytes to 32 bytes.
>
> Regards,
> Martin
>
> (*) people have complained that the memory allocated for a large
> number of ints isn't ever reused. They consumed it by passing
> range() some large argument.

Since range() won't return a real list any more, this no longer is the
case. I worry that dropping the special allocator will be too slow.
And the space increase on 64-bit platforms is too much IMO. But
clearly these issues can only be addressed by careful benchmarking.
Perhaps we should do some of that to settle the issue.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Martin v. Löwis
Guido van Rossum schrieb:
> From the Python *user*'s perspective, yes, as much as possible. But
> I'm still playing with the thought of having two implementation types,
> since otherwise we'd have to devote 4 bytes (8 on a 64-bit platform)
> to the single *bit* telling the difference between the two internal
> representations.

We had this discussion before; if you use ob_size==0 to indicate
that it's an int, this space isn't needed in a long int. On a 32-bit
platform, the size of an int would go up from 12 to 16; if we stop
using a special-cased allocator (which we should (*)), there isn't
any space increase on such a platform. On a 64-bit platform, the
size of an int would go up from 24 bytes to 32 bytes.

Regards,
Martin

(*) people have complained that the memory allocated for a large
number of ints isn't ever reused. They consumed it by passing
range() some large argument.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] IDLE patches - bugfix or not?

2006-08-15 Thread Jim Jewett
I just uploaded a series of IDLE patches, but I'm not quite sure how
to classify them on the feature/bugfix scale now that the last beta is
out.

>From most to least buggish:

python.org/sf/1540892 -- honor the new quit() behavior.  On the other
hand, it was documented that this didn't work in IDLE, and it is
*possible* that someone was counting on this.

python.org/sf/1540851 -- with is now a blockopener, and should be
counted as such -- I *think* this one would be safe, but I know that
changing a parser can be surprising, and I suppose it *could* wait
until with no longer requires a future statement.

python.org/sf/1540874 -- broken shortcut keys.  On windows, only one
entry per menu can be reached with the same shortcut letter, so
advertising others is just an attractive nuisance.  I'm not sure that
other systems wouldn't be able to use the hidden shortcuts.

python.org/sf/1540869 -- GUI fix.  The current code puts in a
separator using a magic number (and has XXX comments about it.)  This
changes the magic number so that the separator is more visible, but
I'm not sure the old behavior rose to a bug, or that it wasn't
platform dependent.

python.org/sf/1540849 -- except too broad.  I wouldn't suggest
applying this late in the release cycle, except that it seems sort of
like the memory errors that are still being patched.

-jJ
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Elementtree and Namespaces in 2.5

2006-08-15 Thread Martijn Faassen
Fredrik Lundh wrote:
> "Chris S" wrote:
> 
>> and while most users and the w3 spec
>> (http://www.w3.org/TR/2001/REC-xml-c14n-20010315#NoNSPrefixRewriting)
>> agree this feature is actually a bug
> 
> ET's not a canonicalization library, and doesn't claim to be one, so that 
> reference isn't
> very relevant.  And "most users" know that ET uses a simplified infoset; it's 
> not exactly
> a secret.

And if you need an XML library with ET's API that does retain namespace 
prefixes and has support for canonicalization and a boatload of other 
features, you could try lxml.

http://codespeak.net/lxml

Regards,

Martijn
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread Gustavo Niemeyer
> If you have issues, respond ASAP!  The release candidate is planned to
> be cut this Thursday/Friday.  There are only a few more days before
> code freeze.  A branch will be made when the release candidate is cut.

I'd like to see problem #1531862 fixed.  The bug is clear and the
fix should be trivial.  I can commit a fix tonight, if the subprocess
module author/maintainer is unavailable to check it out.

-- 
Gustavo Niemeyer
http://niemeyer.net
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread M.-A. Lemburg
Guido van Rossum wrote:
> Marc-Andre,
> 
> I think the release managers might let you change this back if you
> volunteered, not to maintain all of distutils (I wouldn't wish that on
> my worst enemies :-) but at least to keep the version number up to
> date and to do the occasional work to keep it backwards compatible in
> the way you want it.

I guess it's Anthony's turn then... the patch is there and
tested, just waiting in its shell window to get checked
in ;-)

I'll add a distutils checkin message filter to keep me
informed of any changes to distutils.

> I think it's fine of the new distutils contains new features that
> won't work with older Pythons, as long as the old features still work
> (and have perhaps updated functionality in some other way). How
> exactly to reconcile this with the black/white notion of PPE 291 I
> don't know; it seems a compromise is in order.

+1

> --Guido
> 
> On 8/15/06, M.-A. Lemburg <[EMAIL PROTECTED]> wrote:
>> Martin v. Löwis wrote:
>> > Guido van Rossum schrieb:
>> >> I think it must be rolled back, at least as long as
>> >> distutils is officially listed as a package that needs to support
>> >> older versions of Python, which pretty much implies that it's okay to
>> >> extract it from the 2.5 release and distribute it separately for use
>> >> with older Python versions.
>> >
>> > See, it isn't listed as such anymore, not since AMK removed it from
>> > PEP 291.
>> >
>> > That said, I'm not terribly opposed to it being changed back (*) - but
>> > *I* won't change it back (having it changed already twice in two
>> > days). I just wish I could then delegate all bug reports "distutils
>> > doesn't work with older Python releases" to MAL. As far as I'm
>> > concerned, this isn't a distutils feature anymore.
>>
>> How many of those are there ?
>>
>> We're running SVN distutils regularly for Python 2.4 and use
>> the one that shipped with Python 2.3 (the last to support 1.5.2)
>> for all versions between 1.5.2 and 2.3.
>>
>> We haven't hit any bugs related to distutils not being
>> compatible to those Python versions anymore. The few I found
>> over the years, I corrected directly in the repository.
>>
>> I just checked: SVN distutils (at least the parts that we use)
>> still works with Python 2.2. It no longer works with Python 2.1
>> due to the use of "True" and probably a few other things.
>>
>> > Regards,
>> > Martin
>> >
>> > (*) where "back" means 2.5.0, not 2.4.0.
>>
>> -- 
>> Marc-Andre Lemburg
>> eGenix.com
>>
>> Professional Python Services directly from the Source  (#1, Aug 15 2006)
>> >>> Python/Zope Consulting and Support ...http://www.egenix.com/
>> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>> >>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/
>> 
>>
>> ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! 
>>
> 
> 

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 15 2006)
>>> Python/Zope Consulting and Support ...http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/


::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! 
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread M.-A. Lemburg
Martin v. Löwis wrote:
> M.-A. Lemburg schrieb:
>> I find it important to maintain distutils compatibility with
>> a few Python versions back. Even if I can't volunteer to
>> maintain distutils, like Martin suggested, due to lack of time,
>> I don't really see the requirement to use the latest and greatest
>> Python features in distutils, so preserving compatibility
>> with the commonly used Python versions wouldn't hurt.
> 
> Actually, it would. bdist_msi uses extension modules which
> are only available in 2.5. 

bdist_msi is only a small part of distutils. While it would
be great to have that distribution format for 2.3 and 2.4 as well,
I don't think it's vital.

It's simply a feature that is only available when using
Python 2.5.

> Keeping support for the
> compiler-recognizing code in msvccompiler also hurts.

I guess that's something to tell Microsoft ;-)

However, I don't see that as argument for dropping the
distutils support for Python versions prior to 2.5.

> It's either an official feature, with somebody maintaining it,
> or people should expect to break it anytime.

I'll let you know when things break - is that good enough ?

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 15 2006)
>>> Python/Zope Consulting and Support ...http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/


::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! 
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread Guido van Rossum
Marc-Andre,

I think the release managers might let you change this back if you
volunteered, not to maintain all of distutils (I wouldn't wish that on
my worst enemies :-) but at least to keep the version number up to
date and to do the occasional work to keep it backwards compatible in
the way you want it.

I think it's fine of the new distutils contains new features that
won't work with older Pythons, as long as the old features still work
(and have perhaps updated functionality in some other way). How
exactly to reconcile this with the black/white notion of PPE 291 I
don't know; it seems a compromise is in order.

--Guido

On 8/15/06, M.-A. Lemburg <[EMAIL PROTECTED]> wrote:
> Martin v. Löwis wrote:
> > Guido van Rossum schrieb:
> >> I think it must be rolled back, at least as long as
> >> distutils is officially listed as a package that needs to support
> >> older versions of Python, which pretty much implies that it's okay to
> >> extract it from the 2.5 release and distribute it separately for use
> >> with older Python versions.
> >
> > See, it isn't listed as such anymore, not since AMK removed it from
> > PEP 291.
> >
> > That said, I'm not terribly opposed to it being changed back (*) - but
> > *I* won't change it back (having it changed already twice in two
> > days). I just wish I could then delegate all bug reports "distutils
> > doesn't work with older Python releases" to MAL. As far as I'm
> > concerned, this isn't a distutils feature anymore.
>
> How many of those are there ?
>
> We're running SVN distutils regularly for Python 2.4 and use
> the one that shipped with Python 2.3 (the last to support 1.5.2)
> for all versions between 1.5.2 and 2.3.
>
> We haven't hit any bugs related to distutils not being
> compatible to those Python versions anymore. The few I found
> over the years, I corrected directly in the repository.
>
> I just checked: SVN distutils (at least the parts that we use)
> still works with Python 2.2. It no longer works with Python 2.1
> due to the use of "True" and probably a few other things.
>
> > Regards,
> > Martin
> >
> > (*) where "back" means 2.5.0, not 2.4.0.
>
> --
> Marc-Andre Lemburg
> eGenix.com
>
> Professional Python Services directly from the Source  (#1, Aug 15 2006)
> >>> Python/Zope Consulting and Support ...http://www.egenix.com/
> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
> >>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/
> 
>
> ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! 
>


-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Guido van Rossum
On 8/15/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> Guido van Rossum schrieb:
> > FWIW, I propose that in py3k, the int type uses Py_ssize_t instead of long.
>
> This is really a py3k issue, but: shouldn't the int and long types
> really get unified into a single type in Py3k?

>From the Python *user*'s perspective, yes, as much as possible. But
I'm still playing with the thought of having two implementation types,
since otherwise we'd have to devote 4 bytes (8 on a 64-bit platform)
to the single *bit* telling the difference between the two internal
representations. I haven't decided whether to make 'int' an abstract
base type and have 'short' and 'long' subtypes (perhaps using other
names), or whether to make 'int' the base type and 'short' the
subtype, or whether to cheat and hack type() so that type() of any
integer always returns int.  But in any case, this would mean that at
the C level the distinction continues to exist.

Maybe we can discuss this at the sprint next week?

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread M.-A. Lemburg
Martin v. Löwis wrote:
> Guido van Rossum schrieb:
>> I think it must be rolled back, at least as long as
>> distutils is officially listed as a package that needs to support
>> older versions of Python, which pretty much implies that it's okay to
>> extract it from the 2.5 release and distribute it separately for use
>> with older Python versions.
> 
> See, it isn't listed as such anymore, not since AMK removed it from
> PEP 291.
> 
> That said, I'm not terribly opposed to it being changed back (*) - but
> *I* won't change it back (having it changed already twice in two
> days). I just wish I could then delegate all bug reports "distutils
> doesn't work with older Python releases" to MAL. As far as I'm
> concerned, this isn't a distutils feature anymore.

How many of those are there ?

We're running SVN distutils regularly for Python 2.4 and use
the one that shipped with Python 2.3 (the last to support 1.5.2)
for all versions between 1.5.2 and 2.3.

We haven't hit any bugs related to distutils not being
compatible to those Python versions anymore. The few I found
over the years, I corrected directly in the repository.

I just checked: SVN distutils (at least the parts that we use)
still works with Python 2.2. It no longer works with Python 2.1
due to the use of "True" and probably a few other things.

> Regards,
> Martin
> 
> (*) where "back" means 2.5.0, not 2.4.0.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 15 2006)
>>> Python/Zope Consulting and Support ...http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/


::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! 
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread Martin v. Löwis
M.-A. Lemburg schrieb:
> I find it important to maintain distutils compatibility with
> a few Python versions back. Even if I can't volunteer to
> maintain distutils, like Martin suggested, due to lack of time,
> I don't really see the requirement to use the latest and greatest
> Python features in distutils, so preserving compatibility
> with the commonly used Python versions wouldn't hurt.

Actually, it would. bdist_msi uses extension modules which
are only available in 2.5. Keeping support for the
compiler-recognizing code in msvccompiler also hurts.

It's either an official feature, with somebody maintaining it,
or people should expect to break it anytime.

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Martin v. Löwis
Guido van Rossum schrieb:
> FWIW, I propose that in py3k, the int type uses Py_ssize_t instead of long.

This is really a py3k issue, but: shouldn't the int and long types
really get unified into a single type in Py3k?

I suppose the "i" parameter to PyArg_ParseTuple would continue to parse
int?

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Martin v. Löwis
Alexander Belopolsky schrieb:
> Another reason is that POSIX interprets negative values of ssize_t as  
> "an error indication", not as an offset from the end. A better POSIX  
> analogy would be off_t (as used in lseek).

That's subtle. By this reasoning, ptrdiff_t would be wrong, as well,
since it really means "negative index", not "count from the end".

>> In the discussion, ptrdiff_t was never brought up as an alternative
> 
> Yes, it was, by you  January/059562.html> :-).

Ah, that's why it isn't ptrdiff_t: Tim Peters said he liked ssize_t

> I was not suggesting Py_ptrdiff_t.  My suggestion was "Py_index_t",  
> but I am six month late :-(.

Indeed, it is too late for such a change.

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread Martin v. Löwis
Guido van Rossum schrieb:
> I am sympathetic to this case. Is there any advantage to the *users*
> of distutils of the dynamic version number?

This series of commits was triggered by a user who wondered why
Python 2.4.3 ships with distutils 2.4.1, yet Python 2.5bsomething
ships with the older 2.4.0; he requested that the newer release
of distutils should be included in Python 2.5.

So the advantage to the user is that the distutils version numbers
become less confusing, and more "correct" (as long as the packaged
distutils is used).

> If it's only done for the
> benefit of the release managers (with whose plight I also
> sympathesize)

In principle, the release manager shouldn't be the one updating
the distutils release number. Instead, whoever modifies distutils
needs to decide whether this change is a bug fix (subminor change)
or feature change (minor number changes).

> I think it must be rolled back, at least as long as
> distutils is officially listed as a package that needs to support
> older versions of Python, which pretty much implies that it's okay to
> extract it from the 2.5 release and distribute it separately for use
> with older Python versions.

See, it isn't listed as such anymore, not since AMK removed it from
PEP 291.

That said, I'm not terribly opposed to it being changed back (*) - but
*I* won't change it back (having it changed already twice in two
days). I just wish I could then delegate all bug reports "distutils
doesn't work with older Python releases" to MAL. As far as I'm
concerned, this isn't a distutils feature anymore.

Regards,
Martin

(*) where "back" means 2.5.0, not 2.4.0.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread M.-A. Lemburg
Guido van Rossum wrote:
> On 8/15/06, M.-A. Lemburg <[EMAIL PROTECTED]> wrote:
>> The distutils version number should be changed back to a static
>> string literal.
>>
>> It's currently setup to get its version number
>> from the Python version running it which pretty much defeats
>> the whole purpose of having a version number and makes using the
>> SVN distutils package with other Python versions problematic.
> 
> I am sympathetic to this case. Is there any advantage to the *users*
> of distutils of the dynamic version number? If it's only done for the
> benefit of the release managers (with whose plight I also
> sympathesize)

FWIW, I've already volunteered to do the version bumping to take
that burden off the release managers.

> I think it must be rolled back, at least as long as
> distutils is officially listed as a package that needs to support
> older versions of Python, which pretty much implies that it's okay to
> extract it from the 2.5 release and distribute it separately for use
> with older Python versions.

Well, that's another point we should discuss after 2.5 is
out the door: distutils was delisted from PEP 291 (without
public discussion).

I find it important to maintain distutils compatibility with
a few Python versions back. Even if I can't volunteer to
maintain distutils, like Martin suggested, due to lack of time,
I don't really see the requirement to use the latest and greatest
Python features in distutils, so preserving compatibility
with the commonly used Python versions wouldn't hurt.

It makes the life of Python extension writers a tad easier
and Python users benefit as a result of being able to download
pre-built binaries without being forced to upgrade (this is
esp. true for Python users on Windows).

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 15 2006)
>>> Python/Zope Consulting and Support ...http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/


::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! 
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Guido van Rossum
FWIW, I propose that in py3k, the int type uses Py_ssize_t instead of long.

Already decided is that in py3k, the (x)range object will support
arbitrary integer sizes, so that e.g. range(10**10, 10**10+10) is
valid (it currently is, but for different reasons, it isn't with
xrange, which will replace range in py3k).

For 2.6 and onwards, I propose to let the issue rest *or* eventually
backport the py3k xrange implementation; "fixing" xrange to use
Py_ssize_t doesn't seem worth the churn.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread Guido van Rossum
On 8/15/06, M.-A. Lemburg <[EMAIL PROTECTED]> wrote:
> The distutils version number should be changed back to a static
> string literal.
>
> It's currently setup to get its version number
> from the Python version running it which pretty much defeats
> the whole purpose of having a version number and makes using the
> SVN distutils package with other Python versions problematic.

I am sympathetic to this case. Is there any advantage to the *users*
of distutils of the dynamic version number? If it's only done for the
benefit of the release managers (with whose plight I also
sympathesize) I think it must be rolled back, at least as long as
distutils is officially listed as a package that needs to support
older versions of Python, which pretty much implies that it's okay to
extract it from the 2.5 release and distribute it separately for use
with older Python versions.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Alexander Belopolsky

On Aug 15, 2006, at 12:14 AM, Guido van Rossum wrote:

>
> Feel free to submit a patch for Python 2.6.

Please see http://sourceforge.net/tracker/index.php? 
func=detail&aid=1540617&group_id=5470&atid=305470


> Perhaps it is in POSIX?

Yes, "ssize_t - Used for a count of bytes or an error indication.",  
defined in sys/types.h .

I promised to shut up, but let me respond to Martin:

On Aug 15, 2006, at 3:25 AM, Martin v. Löwis wrote:
> Alexander Belopolsky wrote:
>> [snip] I did not notice the double 's' and thought it was an
>> unsigned type.
>
> Hmm. That you fail to read it correctly can hardly be an argument
> against it.

Google tells me I am not the only one: .
What happened to "readability counts"?


>
> In the rationale (XRAT) they say
>
> "This is intended to be a signed analog of size_t."

That's POSIX rationale . PEP 353 says: "A new type Py_ssize_t is  
introduced, which has the same size as the compiler's size_t type,  
but is signed."

>
> They don't mandate it to have the same size, but it is the expectation
> that implementations typically will.

That's one of the reasons why POSIX' ssize_t is a wrong analogy.   
Another reason is that POSIX interprets negative values of ssize_t as  
"an error indication", not as an offset from the end. A better POSIX  
analogy would be off_t (as used in lseek).

>
> In the discussion, ptrdiff_t was never brought up as an alternative

Yes, it was, by you  :-).

I was not suggesting Py_ptrdiff_t.  My suggestion was "Py_index_t",  
but I am six month late :-(.

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread M.-A. Lemburg
Neal Norwitz wrote:
> I just updated the PEP to remove all references to issues blocking
> release of 2.5.
> I don't know of any.  I haven't heard of any issues with the fixes
> that have been checked in.
> 
> If you have issues, respond ASAP!  The release candidate is planned to
> be cut this Thursday/Friday.  There are only a few more days before
> code freeze.  A branch will be made when the release candidate is cut.

The distutils version number should be changed back to a static
string literal.

It's currently setup to get its version number
from the Python version running it which pretty much defeats
the whole purpose of having a version number and makes using the
SVN distutils package with other Python versions problematic.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 15 2006)
>>> Python/Zope Consulting and Support ...http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/


::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! 
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] no remaining issues blocking 2.5 release

2006-08-15 Thread Thomas Heller
Neal Norwitz schrieb:
> I just updated the PEP to remove all references to issues blocking
> release of 2.5.
> I don't know of any.  I haven't heard of any issues with the fixes
> that have been checked in.
> 
> If you have issues, respond ASAP!  The release candidate is planned to
> be cut this Thursday/Friday.  There are only a few more days before
> code freeze.  A branch will be made when the release candidate is cut.

What is the policy for documentation changes?  Am I allowed to check in
changes/additions to the ctypes docs without release manager permission
after the release candidate is out?  I'l always make sure that the html
docs can be built.

Thanks,
Thomas

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Arlington VA sprint on Sept. 23

2006-08-15 Thread Martin v. Löwis
Georg Brandl wrote:
>>> I can guess at Martin's thinking, but I'd rather let him speak for himself, 
>>> since I'm not a trained channeller.  ;-)
>> Essentially, I want to give patches more attention, since they are
>> larger contributions. I don't care if bug reports get unnoticed for
>> years; I do worry if patches get unnoticed/unprocessed for years.
> 
> Then a "has-patch" flag would be okay, wouldn't it, along with assigning
> a higher priority?

Sure, that would work as well.

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Arlington VA sprint on Sept. 23

2006-08-15 Thread Georg Brandl
Martin v. Löwis wrote:
> Fred L. Drake, Jr. wrote:
>> I can guess at Martin's thinking, but I'd rather let him speak for himself, 
>> since I'm not a trained channeller.  ;-)
> 
> Essentially, I want to give patches more attention, since they are
> larger contributions. I don't care if bug reports get unnoticed for
> years; I do worry if patches get unnoticed/unprocessed for years.

Then a "has-patch" flag would be okay, wouldn't it, along with assigning
a higher priority?

Georg

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Arlington VA sprint on Sept. 23

2006-08-15 Thread Martin v. Löwis
Fred L. Drake, Jr. wrote:
> I can guess at Martin's thinking, but I'd rather let him speak for himself, 
> since I'm not a trained channeller.  ;-)

Essentially, I want to give patches more attention, since they are
larger contributions. I don't care if bug reports get unnoticed for
years; I do worry if patches get unnoticed/unprocessed for years.

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Martin v. Löwis
Alexander Belopolsky wrote:
> Since on most platforms ssize_t is the same as long, the choice  
> between the two is just a matter of self-documenting code.

No, it would be an actual change: on Win64,
sizeof(Py_ssize_t)>sizeof(long).

> Speaking  
> of which, I find it unfortunate that the name Py_ssize_t was selected  
> for the typedef.  I would prefer Py_index_t.  The first time I saw  
> Py_ssize_t, I did not notice the double 's' and thought it was an  
> unsigned type.

Hmm. That you fail to read it correctly can hardly be an argument
against it.

> On the second look, I've realized that it is signed  
> and started wondering why not ptrdiff_t.  I understand that ssize_t  
> is defined by POSIX as the return type of functions such as "read"  
> that can return either size or -1 for error.  I don't think POSIX  
> mandates sizeof(size_t) == sizeof(ssize_t), but I may be wrong.

In the rationale (XRAT) they say

"This is intended to be a signed analog of size_t."

They don't mandate it to have the same size, but it is the expectation
that implementations typically will.

> I would agree that ptrdiff_t, although standard C, is not a very  
> intuitive name, but ssize_t is even less clear. 

In the discussion, ptrdiff_t was never brought up as an alternative
(intptr_t was; see the PEP for why it is unsuitable). ssize_t seemed
most natural to me since size_t is the C "number of bytes" type,
and we need a signed version of it.

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Type of range object members

2006-08-15 Thread Martin v. Löwis
Alexander Belopolsky wrote:
> The range object is currently defined in Objects/rangeobject.c as
> 
> typedef struct {
>   PyObject_HEAD
>   longstart;
>   longstep;
>   longlen;
> } rangeobject;
> 
> Is this consistent with PEP 353, or should Py_ssize_t be used instead of long?

As others have said: no. The range object produces ints. People have
asked to make it produce arbitrary longs instead, but none of these
patches ever got successfully reviewed.

> It looks like some of the code in rangeobject.c is already Py_ssize_t
> aware (see range_item and range_length), but it assumes that it is
> safe to cast long to ssize_t and back.

Where does it assume that it is safe to case ssize_t -> long?
That would be a bug.

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com