Re: [Python-Dev] setuptools in the stdlib ([Python-checkins] r45510 - python/trunk/Lib/pkgutil.py python/trunk/Lib/pydoc.py)

2006-04-18 Thread M.-A. Lemburg
Phillip J. Eby wrote: At 10:55 AM 4/18/2006 +0200, M.-A. Lemburg wrote: Phillip.eby wrote: Author: phillip.eby Date: Tue Apr 18 02:59:55 2006 New Revision: 45510 Modified: python/trunk/Lib/pkgutil.py python/trunk/Lib/pydoc.py Log: Second phase of refactoring for runpy

Re: [Python-Dev] setuptools in the stdlib ([Python-checkins] r45510 - python/trunk/Lib/pkgutil.py python/trunk/Lib/pydoc.py)

2006-04-18 Thread M.-A. Lemburg
Phillip J. Eby wrote: At 07:15 PM 4/18/2006 +0200, M.-A. Lemburg wrote: Why should a 3rd party extension be hot-fixing the standard Python distribution ? Because setuptools installs things in zip files, and older versions of pydoc don't work for packages zip files. That doesn't answer my

Re: [Python-Dev] 2.5a1 Performance

2006-04-18 Thread M.-A. Lemburg
Tim Peters wrote: [M.-A. Lemburg] I could contribute pybench to the Tools/ directory if that makes a difference: +1. It's frequently used and nice work. Besides, then we could easily fiddle the tests to make Python look better ;-) That's a good argument :-) Note that the tests

Re: [Python-Dev] unicode vs buffer (array) design issue can crash interpreter

2006-04-14 Thread M.-A. Lemburg
Martin v. Löwis wrote: Neal Norwitz wrote: I'll leave this decision to Martin or someone else, since I'm not familiar with the ramifications. Since it was documented as unsigned, I think it's reasonable to consider changing. Though it could create signed-ness warnings in other modules. I'm

Re: [Python-Dev] unicode vs buffer (array) design issue can crash interpreter

2006-04-14 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: I'd argue that such code is broken anyway: 3rd party code simply cannot make any assumptions on the typedef behind Py_UNICODE. The code would work just fine now, but will stop working with the change. Users of the code might not be open

Re: [Python-Dev] unicode vs buffer (array) design issue can crash interpreter

2006-04-13 Thread M.-A. Lemburg
Neal Norwitz wrote: On 3/31/06, M.-A. Lemburg [EMAIL PROTECTED] wrote: Martin v. Löwis wrote: Neal Norwitz wrote: See http://python.org/sf/1454485 for the gory details. Basically if you create a unicode array (array.array('u')) and try to append an 8-bit string (ie, not unicode), you can

Re: [Python-Dev] int()'s ValueError behaviour

2006-04-09 Thread M.-A. Lemburg
Guido van Rossum wrote: Go ahead and fix it. This was probably never changed since 1990 or so... Do expect some code brakage where people rely on the old behavior. :-( --Guido On 4/9/06, Thomas Wouters [EMAIL PROTECTED] wrote: Someone on IRC (who refuses to report bugs on sourceforge, so

Re: [Python-Dev] The i string-prefix: I18n'ed strings

2006-04-07 Thread M.-A. Lemburg
Martin Blais wrote: Hi all I got an evil idea for Python this morning -- Guido: no, it's not about linked lists :-) -- , and I'd like to bounce it here. But first, a bit of context. This has been discussed a few times before, see e.g.

Re: [Python-Dev] unicode vs buffer (array) design issue can crash interpreter

2006-03-31 Thread M.-A. Lemburg
Martin v. Löwis wrote: Neal Norwitz wrote: See http://python.org/sf/1454485 for the gory details. Basically if you create a unicode array (array.array('u')) and try to append an 8-bit string (ie, not unicode), you can crash the interpreter. The problem is that the string is converted

Re: [Python-Dev] pysqlite for 2.5?

2006-03-30 Thread M.-A. Lemburg
Anthony Baxter wrote: On Thursday 30 March 2006 22:31, M.-A. Lemburg wrote: I don't really care about the name, but please be aware that you are talking about adding a *very* popular module name to the top-level Python namespace if you go for db or database. Why can't we just have

Re: [Python-Dev] pysqlite for 2.5?

2006-03-30 Thread M.-A. Lemburg
Anthony Baxter wrote: On Friday 31 March 2006 02:04, M.-A. Lemburg wrote: Excellent point. Hm. Maybe we should just go with 'sqlite', instead. Anything, but please no db or database top-level module or package :-) How about sql? wink I can't think of a better name right now - can

Re: [Python-Dev] r43214 - peps/trunk/pep-3000.txt

2006-03-23 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: And we still have someone actively interested in maintaining the OS2 port, it seems. Dito for BeOS, now under the name Zeta OS. Who is the one interested in maintaining the BeOS port? the last checkins related to BeOS seem to originate from

[Python-Dev] [Fwd: buildbot warnings in amd64 gentoo trunk]

2006-03-22 Thread M.-A. Lemburg
Would it be possible to redirect these buildbot messages to the python-checkins or a separate python-buildbot list ? Original Message Subject: [Python-Dev] buildbot warnings in amd64 gentoo trunk Date: Wed, 22 Mar 2006 15:18:20 + From: [EMAIL PROTECTED] Reply-To:

Re: [Python-Dev] [Fwd: buildbot warnings in amd64 gentoo trunk]

2006-03-22 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: Would it be possible to redirect these buildbot messages to the python-checkins or a separate python-buildbot list ? Sure. They are sent to python-dev, because I think Tim Peters wanted them here. For the Snake-Farm we had a separate mailing list

Re: [Python-Dev] Documenting the ssize_t Python C API changes

2006-03-21 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: It's not a waste of time at all: you'd be helping lots and lots of developers out there who want to fix their extensions. This is free software, anybody is free to decide what they do. With due respect for other developers, yes. I don't believe

Re: [Python-Dev] Documenting the ssize_t Python C API changes

2006-03-21 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: Here's a grep of all the changed/new APIs, please include it in the PEP. You want me to include that *literally*? Are you serious? Feel free to format it in a different way. Please go ahead and commit that change yourself: I consider

Re: [Python-Dev] Documenting the ssize_t Python C API changes

2006-03-21 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: Interesting: A few mails ago you suggested that developers do exactly what I did to get the list of changes. Now you gripe about the output format of the grep. Developers which use grep can read the output of grep. Developers which use other

Re: [Python-Dev] [Python-checkins] r43041 - python/trunk/Modules/_ctypes/cfield.c

2006-03-20 Thread M.-A. Lemburg
Martin v. Löwis wrote: Fernando Perez wrote: So I think M.A. is right on the money here with his statement. Unless you consider the Linux/64bit camp insignificant. But if that is the case, it might be worth putting a big statement in the 2.5 release notes indicating there is a good chance,

Re: [Python-Dev] Documenting the ssize_t Python C API changes

2006-03-20 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: I really don't understand why you put so much effort into trying to argue that the ssize_t patch isn't going to break extensions or that fixing compiler warnings is good enough. Well, in *this* thread, my main point is that I don't want

Re: [Python-Dev] [Python-checkins] r43041 - python/trunk/Modules/_ctypes/cfield.c

2006-03-18 Thread M.-A. Lemburg
Ronald Oussoren wrote: On 17-mrt-2006, at 22:14, M.-A. Lemburg wrote: Martin v. Löwis wrote: Thomas Heller wrote: I'm not sure if this is what Marc-Andre means, but maybe these definitions could go into a new include file: How would that include file be used? You would have to copy

Re: [Python-Dev] [Python-checkins] r43041 - python/trunk/Modules/_ctypes/cfield.c

2006-03-17 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: Since this change is going to affect a lot of 3rd party extensions, I'd also like to see a complete list of public APIs that changed and how they changed (including the type slots) You can construct this list easily by comparing the header files

Re: [Python-Dev] [Python-checkins] r43041 - python/trunk/Modules/_ctypes/cfield.c

2006-03-17 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: I think it's only fair that I ask the patch authors to complete the PEP, since the ssize_t patch is causing extension authors enough trouble already. Well, the PEP is complete as it stands. It's possible to provide more guidelines

Re: [Python-Dev] [Python-checkins] r43041 - python/trunk/Modules/_ctypes/cfield.c

2006-03-17 Thread M.-A. Lemburg
Martin v. Löwis wrote: Thomas Heller wrote: I'm not sure if this is what Marc-Andre means, but maybe these definitions could go into a new include file: How would that include file be used? You would have to copy it into your own source base, and include it, right? We could put it into a

Re: [Python-Dev] [Python-checkins] r43041 - python/trunk/Modules/_ctypes/cfield.c

2006-03-16 Thread M.-A. Lemburg
Thomas Heller wrote: Martin v. Löwis wrote: Thomas Heller wrote: BTW: Is a porting guide to make extension modules compatible with 2.5 available somewhere? PEP 353 scratches only the surface... Wrt. ssize_t changes, PEP 353 is meant to be comprehensive. Which particular aspect are you

Re: [Python-Dev] Using relative imports in std lib packages ([Python-checkins] r43033 - in python/trunk/Lib: distutils/sysconfig.py encodings/__init__.py)

2006-03-15 Thread M.-A. Lemburg
guido.van.rossum wrote: Author: guido.van.rossum Date: Wed Mar 15 05:33:54 2006 New Revision: 43033 Modified: python/trunk/Lib/distutils/sysconfig.py python/trunk/Lib/encodings/__init__.py Log: Use relative imports in a few places where I noticed the need. (Ideally, all packages

[Python-Dev] FrOSCon 2006 - Call for {Papers|Projects}

2006-03-04 Thread M.-A. Lemburg
Is anyone interested in having a Python track at this conference ? PS: The EuroPython conference takes place in Geneva, one week later. Original Message Subject: FrOSCon 2006 - Call for {Papers|Projects} Date: Fri, 03 Mar 2006 16:39:08 +0100 From: Sebastian Bergmann

Re: [Python-Dev] Stateful codecs [Was: str object going in Py3K]

2006-03-01 Thread M.-A. Lemburg
Walter Dörwald wrote: M.-A. Lemburg wrote: Walter Dörwald wrote: Hye-Shik Chang wrote: On 2/19/06, Walter Dörwald [EMAIL PROTECTED] wrote: M.-A. Lemburg wrote: Walter Dörwald wrote: Anyway, I've started implementing a patch that just adds codecs.StatefulEncoder/codecs.StatefulDecoder

Re: [Python-Dev] Making ascii the default encoding

2006-02-28 Thread M.-A. Lemburg
Neal Norwitz wrote: PEP 263 states that in Phase 2 the default encoding will be set to ASCII. Although the PEP is marked final, this isn't actually implemented. The warning about using non-ASCII characters started in 2.3. Does anyone think we shouldn't enforce the default being ASCII?

Re: [Python-Dev] Removing Non-Unicode Support?

2006-02-21 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: Note that this does not mean that we should forget about memory consumption issues. It's just that if there's only marginal interest in certain special builds of Python, I don't see the requirement for the Python core developers to maintain them

Re: [Python-Dev] Removing Non-Unicode Support?

2006-02-21 Thread M.-A. Lemburg
Jeff Rush wrote: M.-A. Lemburg wrote: I'd say that the parties interested in non-Unicode versions of Python should maintain these branches of Python. Dito for other stripped down versions. I understand where you're coming from but the embedded market I encounter tends to focus

Re: [Python-Dev] Removing Non-Unicode Support?

2006-02-20 Thread M.-A. Lemburg
Jeff Rush wrote: Guido van Rossum wrote: On 2/19/06, Jeff Rush [EMAIL PROTECTED] wrote: [Quoting Neal Norwitz] I've heard of a bunch of people using --disable-unicode. I'm not sure if it's curiosity or if there are really production builds without unicode. Ask this on c.l.p too. Do you

Re: [Python-Dev] [Python-checkins] r42490 - in python/branches/release24-maint: Lib/fileinput.py Lib/test/test_fileinput.py Misc/NEWS

2006-02-19 Thread M.-A. Lemburg
Why are these new features being backported to 2.4 ? georg.brandl wrote: Author: georg.brandl Date: Sun Feb 19 10:51:33 2006 New Revision: 42490 Modified: python/branches/release24-maint/Lib/fileinput.py python/branches/release24-maint/Lib/test/test_fileinput.py

Re: [Python-Dev] [Python-checkins] r42490 - in python/branches/release24-maint: Lib/fileinput.py Lib/test/test_fileinput.py Misc/NEWS

2006-02-19 Thread M.-A. Lemburg
Georg Brandl wrote: M.-A. Lemburg wrote: Why are these new features being backported to 2.4 ? georg.brandl wrote: Author: georg.brandl Date: Sun Feb 19 10:51:33 2006 New Revision: 42490 Modified: python/branches/release24-maint/Lib/fileinput.py python/branches/release24-maint/Lib

Re: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]

2006-02-18 Thread M.-A. Lemburg
Martin, v. Löwis wrote: How are users confused? Users do py Martin v. Löwis.encode(utf-8) Traceback (most recent call last): File stdin, line 1, in ? UnicodeDecodeError: 'ascii' codec can't decode byte 0xf6 in position 11: ordinal not in range(128) because they want to convert the

Re: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]

2006-02-18 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: Just because some codecs don't fit into the string.decode() or bytes.encode() scenario doesn't mean that these codecs are useless or that the methods should be banned. No. The reason to ban string.decode and bytes.encode is that it confuses users

Re: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]

2006-02-18 Thread M.-A. Lemburg
Thomas Wouters wrote: On Sat, Feb 18, 2006 at 12:06:37PM +0100, M.-A. Lemburg wrote: I've already explained why we have .encode() and .decode() methods on strings and Unicode many times. I've also explained the misunderstanding that can codecs only do Unicode-string conversions. And I've

Re: [Python-Dev] A codecs nit

2006-02-18 Thread M.-A. Lemburg
Barry Warsaw wrote: On Wed, 2006-02-15 at 22:07 +0100, M.-A. Lemburg wrote: Those are not pseudo-encodings, they are regular codecs. It's a common misunderstanding that codecs are only seen as serving the purpose of converting between Unicode and strings. The codec system is deliberately

Re: [Python-Dev] bytes.from_hex()

2006-02-18 Thread M.-A. Lemburg
Aahz wrote: On Sat, Feb 18, 2006, Ron Adam wrote: I like the bytes.recode() idea a lot. +1 It seems to me it's a far more useful idea than encoding and decoding by overloading and could do both and more. It has a lot of potential to be an intermediate step for encoding as well as being

Re: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]

2006-02-18 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: I've already explained why we have .encode() and .decode() methods on strings and Unicode many times. I've also explained the misunderstanding that can codecs only do Unicode-string conversions. And I've explained that the .encode() and .decode

Re: [Python-Dev] Stateful codecs [Was: str object going in Py3K]

2006-02-18 Thread M.-A. Lemburg
Walter Dörwald wrote: M.-A. Lemburg wrote: Walter Dörwald wrote: I'd suggest we keep codecs.lookup() the way it is and instead add new functions to the codecs module, e.g. codecs.getencoderobject() and codecs.getdecoderobject(). Changing the codec registration is not much of a problem: we

Re: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]

2006-02-18 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: True. However, note that the .encode()/.decode() methods on strings and Unicode narrow down the possible return types. The corresponding .bytes methods should only allow bytes and Unicode. I forgot that: what is the rationale for that restriction

Re: [Python-Dev] Pre-PEP: The bytes object

2006-02-17 Thread M.-A. Lemburg
Guido van Rossum wrote: On 2/15/06, Neil Schemenauer [EMAIL PROTECTED] wrote: This could be a replacement for PEP 332. At least I hope it can serve to summarize the previous discussion and help focus on the currently undecided issues. I'm too tired to dig up the rules for assigning it a PEP

Re: [Python-Dev] str object going in Py3K

2006-02-17 Thread M.-A. Lemburg
Guido van Rossum wrote: On 2/16/06, M.-A. Lemburg [EMAIL PROTECTED] wrote: What will be the explicit way to open a file in bytes mode and in text mode (I for one would like to move away from open() completely as well) ? Will we have a single file type with two different modes or two

Re: [Python-Dev] str.translate vs unicode.translate

2006-02-17 Thread M.-A. Lemburg
Bengt Richter wrote: If str becomes unicode for PY 3000, and we then have bytes as out coding-agnostic byte data, then I think bytes should have the str translation method, with a tweak that I would hope could also be done to str now. BTW, str.translate will presumably become

Re: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]

2006-02-17 Thread M.-A. Lemburg
Martin v. Löwis wrote: Josiah Carlson wrote: I would agree that zip is questionable, but 'uu', 'rot13', perhaps 'hex', and likely a few others that the two of you may be arguing against should stay as encodings, because strictly speaking, they are defined as encodings of data. They may not

Re: [Python-Dev] [Python-checkins] r42396 - peps/trunk/pep-0011.txt

2006-02-17 Thread M.-A. Lemburg
a deprecation warning for that in Py 2.5 and then remove the hundreds of #idef Py_USING_UNICODE from the source code in time for Py 2.6. n -- On 2/16/06, M.-A. Lemburg [EMAIL PROTECTED] wrote: neal.norwitz wrote: Author: neal.norwitz Date: Thu Feb 16 06:25:37 2006 New Revision: 42396

Re: [Python-Dev] Stateful codecs [Was: str object going in Py3K]

2006-02-17 Thread M.-A. Lemburg
Walter Dörwald wrote: M.-A. Lemburg wrote: Walter Dörwald wrote: Guido van Rossum wrote: [...] Years ago I wrote a prototype; checkout sandbox/sio/. However sio.DecodingInputFilter and sio.EncodingOutputFilter don't work for encodings that need state (e.g. when reading/writing UTF-16

Re: [Python-Dev] Stateful codecs [Was: str object going in Py3K]

2006-02-17 Thread M.-A. Lemburg
Walter Dörwald wrote: I'd suggest we keep codecs.lookup() the way it is and instead add new functions to the codecs module, e.g. codecs.getencoderobject() and codecs.getdecoderobject(). Changing the codec registration is not much of a problem: we could simply allow 6-tuples to be passed into

Re: [Python-Dev] from __future__ import unicode_strings?

2006-02-16 Thread M.-A. Lemburg
Neil Schemenauer wrote: On Thu, Feb 16, 2006 at 02:43:02AM +0100, Thomas Wouters wrote: On Wed, Feb 15, 2006 at 05:23:56PM -0800, Guido van Rossum wrote: from __future__ import unicode_strings Didn't we have a command-line option to do this? I believe it was removed because nobody could

Re: [Python-Dev] from __future__ import unicode_strings?

2006-02-16 Thread M.-A. Lemburg
Giovanni Bajo wrote: Thomas Wouters [EMAIL PROTECTED] wrote: from __future__ import unicode_strings Didn't we have a command-line option to do this? I believe it was removed because nobody could see the point. (Or am I hallucinating? After several days of non-stop discussing bytes that

Re: [Python-Dev] from __future__ import unicode_strings?

2006-02-16 Thread M.-A. Lemburg
Jean-Paul Calderone wrote: On Thu, 16 Feb 2006 11:24:35 +0100, M.-A. Lemburg [EMAIL PROTECTED] wrote: Neil Schemenauer wrote: On Thu, Feb 16, 2006 at 02:43:02AM +0100, Thomas Wouters wrote: On Wed, Feb 15, 2006 at 05:23:56PM -0800, Guido van Rossum wrote: from __future__ import

Re: [Python-Dev] str object going in Py3K

2006-02-16 Thread M.-A. Lemburg
Guido van Rossum wrote: On 2/15/06, Alex Martelli [EMAIL PROTECTED] wrote: I agree, or, MAL's idea of bytes.open() and unicode.open() is also good. No, the bytes and text data types shouldn't have to be tied to the I/O system. (The latter tends to evolve at a much faster rate so should be

Re: [Python-Dev] str object going in Py3K

2006-02-15 Thread M.-A. Lemburg
Guido van Rossum wrote: On 2/15/06, Nick Coghlan [EMAIL PROTECTED] wrote: If we went with longer names, a slight variation on the opentext/openbinary idea would be to use opentext and opendata. After some thinking I don't like opendata any more -- often data is text, so the term is wrong.

Re: [Python-Dev] str object going in Py3K

2006-02-15 Thread M.-A. Lemburg
Barry Warsaw wrote: On Wed, 2006-02-15 at 18:29 +0100, M.-A. Lemburg wrote: Maybe a weird idea, but why not use static methods on the bytes and str type objects for this ?! E.g. bytes.openfile(...) and unicode.openfile(...) (in 3.0 renamed to str.openfile()) That's also not a bad idea

Re: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]

2006-02-15 Thread M.-A. Lemburg
Jason Orendorff wrote: Instead of byte literals, how about a classmethod bytes.from_hex(), which works like this: # two equivalent things expected_md5_hash = bytes.from_hex('5c535024cac5199153e3834fe5c92e6a') expected_md5_hash = bytes([92, 83, 80, 36, 202, 197, 25, 145, 83, 227, 131,

Re: [Python-Dev] Baffled by PyArg_ParseTupleAndKeywords modification

2006-02-14 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: It's the consequences: nobody complains about tacking const on to a former honest-to-God char * argument that was in fact not modified, because that's not only helpful for C++ programmers, it's _harmless_ for all programmers. For example, nobody

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-14 Thread M.-A. Lemburg
James Y Knight wrote: Kill the encoding argument, and you're left with: Python2.X: - bytes(bytes_object) - copy constructor - bytes(str_object) - copy the bytes from the str to the bytes object - bytes(sequence_of_ints) - make bytes with the values of the ints, error on overflow

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-14 Thread M.-A. Lemburg
Guido van Rossum wrote: On 2/13/06, M.-A. Lemburg [EMAIL PROTECTED] wrote: Guido van Rossum wrote: It'd be cruel and unusual punishment though to have to write bytes(abc, Latin-1) I propose that the default encoding (for basestring instances) ought to be ascii just like everywhere else

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-13 Thread M.-A. Lemburg
Guido van Rossum wrote: One recommendation: for starters, I'd much rather see the bytes type standardized without a literal notation. There should be are lots of ways to create bytes objects from string objects, with specific explicit encodings, and those should suffice, at least initially.

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-13 Thread M.-A. Lemburg
Guido van Rossum wrote: On 2/13/06, Phillip J. Eby [EMAIL PROTECTED] wrote: At 09:55 AM 2/13/2006 -0800, Guido van Rossum wrote: One recommendation: for starters, I'd much rather see the bytes type standardized without a literal notation. There should be are lots of ways to create bytes

Re: [Python-Dev] Baffled by PyArg_ParseTupleAndKeywords modification

2006-02-13 Thread M.-A. Lemburg
Tim Peters wrote: [Jeremy] I added some const to several API functions that take char* but typically called by passing string literals. [Tim] If he had _stuck_ to that, we wouldn't be having this discussion :-) (that is, nobody passes string literals to PyArg_ParseTupleAndKeywords's kws

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-13 Thread M.-A. Lemburg
Phillip J. Eby wrote: Why not just have the constructor be: bytes(initializer [,encoding]) Where initializer must be either an iterable of suitable integers, or a unicode/string object. If the latter (i.e., it's a basestring), the encoding argument would then be required. Then,

Re: [Python-Dev] release plan for 2.5 ?

2006-02-10 Thread M.-A. Lemburg
Guido van Rossum wrote: PEP 328: Absolute/Relative Imports Yes, please. +0 for adding relative imports. -1 for raising errors for in-package relative imports using the current notation in Python 2.6. See: http://mail.python.org/pipermail/python-dev/2004-September/048695.html for a

Re: [Python-Dev] Path inherits from string

2006-01-26 Thread M.-A. Lemburg
BJörn Lindqvist wrote: This seems to be the only really major issue with the PEP. Everything else is negotiable, IMHO. But the string inheritance seem to be such a critical issue it deserves its own thread. I have tried to address all criticism of it here: I don't see why this is critical for

Re: [Python-Dev] Path inherits from string

2006-01-26 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: Please note that inheritance from string will cause the C type checks of the form PyString_Check(obj) to return true. C code will then assume that it has an object which is compatible to string C API which instances aren't. Oh, sure

Re: [Python-Dev] New PEP: Using ssize_t as the index type

2006-01-19 Thread M.-A. Lemburg
Neal Norwitz wrote: On 1/10/06, M.-A. Lemburg [EMAIL PROTECTED] wrote: We'd also have to make sure that old extensions don't just import with a warning, since the change will introduce buffer overflows and seg faults in extensions that are not aware of the change. I agree that on 64-bit

Re: [Python-Dev] basenumber redux

2006-01-18 Thread M.-A. Lemburg
Alex Martelli wrote: On 1/17/06, M.-A. Lemburg [EMAIL PROTECTED] wrote: Alex, I think you're missing a point here: what you are looking for is an interface, not a base class - simply because the I expect numbers to support arithmetic operators, c -- no need for basenumber to spell this out

Re: [Python-Dev] basenumber redux

2006-01-17 Thread M.-A. Lemburg
Alex, I think you're missing a point here: what you are looking for is an interface, not a base class - simply because the assumptions you make when finding a KnownNumberTypes instance are only related to an interface you expect them to provide. A common case class won't really help all that much

Re: [Python-Dev] str with base

2006-01-17 Thread M.-A. Lemburg
Alex Martelli wrote: Is it finally time in Python 2.5 to allow the obvious use of, say, str(5,2) to give '101', just the converse of the way int('101',1) gives 5? I'm not sure why str has never allowed this obvious use -- any bright beginner assumes it's there and it's awkward to

Re: [Python-Dev] r42015 - peps/trunk

2006-01-13 Thread M.-A. Lemburg
David Goodger wrote: On 1/12/06, M.-A. Lemburg [EMAIL PROTECTED] wrote: I know, but I wouldn't expect SVN to query other servers than svn.python.org inside the standard repository directories. AFAIK, this is a first in the Python repository. True, and worth discussing. Luckily the PEPs

Re: [Python-Dev] Py_ssize_t output parameters (Was: [Python-checkins] r41971 ...)

2006-01-13 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: What if x64 has a 64-bit value ? How do you catch and process the truncation error ? We were *both* discussing a scenario where no sizes exceed 2**31, right? Right, but I don't see the point of each and every extension having to go through

Re: [Python-Dev] Py_ssize_t output parameters (Was: [Python-checkins] r41971 ...)

2006-01-12 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: ... and then the type change of that variable propagates throughout the extension. That depends on the usage of the code. If the variable is passed by value, no further changes are necessary. If a pointer to the variable is passed, you could

Re: [Python-Dev] New PEP: Using ssize_t as the index type

2006-01-12 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: If it were this easy, I wouldn't have objections. But it's not. It is so easy. Can you should me an example where it isn't? The variables you use with these APIs tend to propagate through the extension, you use them in other calls, make

Re: [Python-Dev] r42015 - peps/trunk

2006-01-12 Thread M.-A. Lemburg
David Goodger wrote: Author: david.goodger Date: Thu Jan 12 04:33:16 2006 New Revision: 42015 Modified: peps/trunk/ (props changed) Log: add external link to Docutils public repo -- always up-to-date I just deleted the static copy of the docutils directory from the peps

Re: [Python-Dev] r42015 - peps/trunk

2006-01-12 Thread M.-A. Lemburg
David Goodger wrote: [M.-A. Lemburg] Question: why do we need docutils in the peps/trunk/ directory in the first place ? It's a convenience, so that a separate Docutils download install ( maintain) isn't necessary for those who process reST-format PEPs. Hmm, shouldn't these things

Re: [Python-Dev] r42015 - peps/trunk

2006-01-12 Thread M.-A. Lemburg
David Goodger wrote: On 1/12/06, M.-A. Lemburg [EMAIL PROTECTED] wrote: Hmm, shouldn't these things be tracked under external/ ?! What do you mean exactly? A new external directory? Yes. SVN provides a built-in mechanism for tracking external repositories, via the svn:externals property

Re: [Python-Dev] New PEP: Using ssize_t as the index type

2006-01-10 Thread M.-A. Lemburg
Martin v. Löwis wrote: Armin Rigo wrote: This would do the right thing for = 2.4, using ints everywhere; and the Python.h version 2.5 would detect the #define and assume it's a 2.5-compatible module, so it would override the #define with the real thing *and* turn on the ssize_t interpretation

Re: [Python-Dev] New PEP: Using ssize_t as the index type

2006-01-10 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: I don't see a good solution for these other than introducing a set of new APIs (and maybe doing some macro magic as Martin did for PyArg_ParseTuple()). Due to the fact that changes in the types of output parameters require changes in the extension

Re: [Python-Dev] [Doc-SIG] that library reference, again

2005-12-30 Thread M.-A. Lemburg
I haven't followed the thread, so many I'm repeating things. Has anyone considered using e.g. MediaWiki (the wiki used for Wikipedia) for Python documentation ? I'm asking because this wiki has proven to be ideally suited for creating complex documentation tasks and offers many features which

Re: [Python-Dev] NotImplemented reaching top-level

2005-12-29 Thread M.-A. Lemburg
Hi Armin, On Wed, Dec 28, 2005 at 09:56:43PM +0100, M.-A. Lemburg wrote: d += 1.2 d NotImplemented The PEP documenting the coercion logic has complete tables for what should happen: Well, '+=' does not invoke coercion at all, with new-style classes like Decimal. True, it doesn't invoke

Re: [Python-Dev] NotImplemented reaching top-level

2005-12-28 Thread M.-A. Lemburg
Armin Rigo wrote: Hi Facundo, On Sat, Dec 24, 2005 at 02:31:19PM -0300, Facundo Batista wrote: d += 1.2 d NotImplemented The situation appears to be a mess. Some combinations of specific operators fail to convert NotImplemented to a TypeError, depending on old- or

Re: [Python-Dev] file() vs open(), round 7

2005-12-27 Thread M.-A. Lemburg
Fredrik Lundh wrote: Aahz wrote: class file(object) | file(name[, mode[, buffering]]) - file object | | Open a file. The mode can be 'r', 'w' or 'a' for reading (default), [...] | Note: open() is an alias for file(). This is confusing. I suggest that we make ``open()`` a factory

Re: [Python-Dev] file() vs open(), round 7

2005-12-27 Thread M.-A. Lemburg
Fredrik Lundh wrote: M.-A. Lemburg wrote: can we add a opentext factory for file/codecs.open while we're at it ? Why a new factory function ? Can't we just redirect to codecs.open() in case an encoding keyword argument is passed to open() ?! I think open is overloaded enough

Re: [Python-Dev] file() vs open(), round 7

2005-12-27 Thread M.-A. Lemburg
Phillip J. Eby wrote: At 02:35 PM 12/27/2005 +0100, Fredrik Lundh wrote: M.-A. Lemburg wrote: can we add a opentext factory for file/codecs.open while we're at it ? Why a new factory function ? Can't we just redirect to codecs.open() in case an encoding keyword argument is passed to open

Re: [Python-Dev] file() vs open(), round 7

2005-12-27 Thread M.-A. Lemburg
Phillip J. Eby wrote: At 04:20 PM 12/27/2005 +0100, M.-A. Lemburg wrote: Phillip J. Eby wrote: At 02:35 PM 12/27/2005 +0100, Fredrik Lundh wrote: M.-A. Lemburg wrote: can we add a opentext factory for file/codecs.open while we're at it ? Why a new factory function ? Can't we just

Re: [Python-Dev] file() vs open(), round 7

2005-12-27 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: Here's a rough draft: def textopen(name, mode=r, encoding=None): if U not in mode: mode += U The U is not needed when opening files using codecs - these always break lines using .splitlines() which breaks lines according

Re: [Python-Dev] Keep default comparisons - or add a second set?

2005-12-20 Thread M.-A. Lemburg
Josiah Carlson wrote: Jim Fulton [EMAIL PROTECTED] wrote: Jim Jewett wrote: PEP 3000 now suggests that dropping default comparison has become more than an idle what-if. Unfortunately, one very common use case of comparisons is to get a canonical order. If the order is sensible, all the

Re: [Python-Dev] Sets are mappings?

2005-12-20 Thread M.-A. Lemburg
Aahz wrote: On Tue, Dec 20, 2005, M.-A. Lemburg wrote: Josiah Carlson wrote: New superclasses for all built-in types (except for string and unicode, which already subclass from basestring). int, float, complex (long) : subclass from basenumber tuple, list, set : subclass from basesequence

Re: [Python-Dev] ElementTree in stdlib

2005-12-14 Thread M.-A. Lemburg
Fredrik Lundh wrote: M.-A. Lemburg wrote: Some questions: * Are you going to contribute cElementTree as well ? yes, but there are some build issues we need to sort out first (both pyexpat and cET link to their own copies of expat) Great ! we also need to figure out how to import

Re: [Python-Dev] registering unicode codecs

2005-11-24 Thread M.-A. Lemburg
Neal Norwitz wrote: While running regrtest with -R to find reference leaks I found a usage issue. When a codec is registered it is stored in the interpreter state and cannot be removed. Since it is stored as a list, if you repeated add the same search function, you will get duplicates in the

Re: [Python-Dev] registering unicode codecs

2005-11-24 Thread M.-A. Lemburg
Neal Norwitz wrote: On 11/24/05, M.-A. Lemburg [EMAIL PROTECTED] wrote: Should users have access to the search path (through a codecs.unregister())? Maybe, but why would you want to unregister a search function ? If so, should it search from the end of the list to the beginning to remove

Re: [Python-Dev] str.dedent

2005-11-13 Thread M.-A. Lemburg
Noam Raphael wrote: Following Avi's suggestion, can I raise this thread up again? I think that Reinhold's .dedent() method can be a good idea after all. The idea is to add a method called dedent to strings. It would do exactly what the current textwrap.indent function does. You are missing

Re: [Python-Dev] Adding examples to PEP 263

2005-11-04 Thread M.-A. Lemburg
Fredrik Lundh wrote: the runtime warning you get when you use non-ascii characters in python source code points the poor user to this page: http://www.python.org/peps/pep-0263.html which tells the user to add a # -*- coding: encoding name -*- to the source, and then provides

Re: [Python-Dev] PEP 328 - absolute imports (python-dev sprint at PyCon)

2005-11-01 Thread M.-A. Lemburg
Guido van Rossum wrote: On 11/1/05, Phillip J. Eby [EMAIL PROTECTED] wrote: At 10:22 AM 11/1/2005 -0700, Guido van Rossum wrote: * PEP 328 - absolute/relative import I assume that references to 2.4 in that PEP should be changed to 2.5, and so on. For the part that hasn't been implemented

Re: [Python-Dev] i18n identifiers

2005-10-31 Thread M.-A. Lemburg
Martin v. Löwis wrote: Steve Holden wrote: Therefore, if such steps are really going to be considered, I would really like to see them introduced in such a way that no breakage occurs for existing users, even the parochial ones who feel they (and their programs) don't need to understand

Re: [Python-Dev] Divorcing str and unicode (no more implicitconversions).

2005-10-27 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: You even argued against having non-ASCII identifiers: http://mail.python.org/pipermail/python-list/2002-May/102936.html I see :-) It seems I have changed my mind since then (which apparently predates PEP 263). One issue I apparently

Re: [Python-Dev] Divorcing str and unicode (no more implicitconversions).

2005-10-27 Thread M.-A. Lemburg
Greg Ewing wrote: M.-A. Lemburg wrote: If you are told to debug a program written by say a Japanese programmer using Japanese identifiers you are going to have a really hard time. Or you could look upon it as an opportunity to broaden your mental horizons by learning some Japanese

Re: [Python-Dev] Divorcing str and unicode (no more implicitconversions).

2005-10-26 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: A few years ago we had a discussion about this on python-dev and agreed to stick with ASCII identifiers for Python. I still think that's the right way to go. I don't think there ever was such an agreement. You even argued against having non-ASCII

Re: [Python-Dev] Divorcing str and unicode (no more implicit conversions).

2005-10-25 Thread M.-A. Lemburg
Neil Hodgson wrote: M.-A. Lemburg: Unicode has the concept of combining code points, e.g. you can store an é (e with a accent) as e + '. Now if you slice off the accent, you'll break the character that you encoded using combining code points. ... next_indextype(u, index) - integer

Re: [Python-Dev] New codecs checked in

2005-10-25 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: I just left them in because I thought they wouldn't do any harm and might be useful in some applications. Removing them where not directly needed by the codec would not be a problem. I think memory usage caused is measurable (I estimated 4KiB

<    4   5   6   7   8   9   10   >