Re: [Python-Dev] [Py3k] curses module and libncursesw library

2009-01-07 Thread Jeroen Ruigrok van der Werven
-On [20090108 02:23], Victor Stinner (victor.stin...@haypocalc.com) wrote: >It looks like libncursesw is available on Linux, *BSD, Mac OS X. On FreeBSD I know it is for 7.x, but I am not sure about 6.x. -- Jeroen Ruigrok van der Werven / asmodai イェルーン ラウフロック ヴァン デル ウェルヴェン http://www.in-nomine.o

[Python-Dev] Can someone explain the fast_block_end manipulation?

2009-01-07 Thread skip
> I don't see anyplace obvious where a value resembling a jump offset or > jump target was pushed onto the stack. Duh. Found it about one minute after sending... CONTINUE_LOOP. Skip ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.

[Python-Dev] Can someone explain the fast_block_end manipulation?

2009-01-07 Thread skip
Everybody seems to be doing stuff with the virtual machine all of a sudden. I thought I would get in on the fun. I am generating functions from the byte code which pretty much just inlines the C code implementing each opcode. The idea is to generate a C function that looks like a small version o

[Python-Dev] What's New in Python 2.6: no string exceptions

2009-01-07 Thread Daniel Stutzbach
After reading "What's New in Python 2.6" and then upgrading, I quickly noticed an omission: string exceptions are no longer supported and raise a TypeError. It seems like this should be mentioned in the "Porting to Python 2.6" section at minimum, or perhaps more prominently since this change will

[Python-Dev] [Py3k] curses module and libncursesw library

2009-01-07 Thread Victor Stinner
Hi, Python2 and Python3 tries to link the Python _curses module to the libncusesw dynamic library, or fallback to libncurses (or another implementation). The problem of libncurses is that it doesn't support multibyte charsets like... utf-8. In the Python module, it's not possible to check if we

Re: [Python-Dev] error in doc for fcntl module

2009-01-07 Thread Guido van Rossum
Well my Linux man page says that the only flags supported are O_APPEND, O_ASYNC, O_DIRECT, O_NOATIME, and O_NONBLOCK; and all of those are typically off -- so I'm not sure that it's a mistake or need correcting. These APIs should only be used by people who know what they're doing anyways; the exa

Re: [Python-Dev] Decoder functions accept str in py3k

2009-01-07 Thread Collin Winter
On Wed, Jan 7, 2009 at 2:35 PM, Brett Cannon wrote: > On Wed, Jan 7, 2009 at 10:57, M.-A. Lemburg wrote: > [SNIP] >> BTW: The _codecsmodule.c file is a 4 spaces indent file as well (just >> like all Unicode support source files). Someone apparently has added >> tabs when adding support for Py_buf

Re: [Python-Dev] Decoder functions accept str in py3k

2009-01-07 Thread Terry Reedy
Guido van Rossum wrote: OK, ignore my previous comment. Sounds like the inidividual codecs need to tighten their type checking though -- perhaps *that* can be fixed in 3.0.1? I really don't see why any codec used to convert between text and bytes should support its output type as input. --Guido

Re: [Python-Dev] Decoder functions accept str in py3k

2009-01-07 Thread Brett Cannon
On Wed, Jan 7, 2009 at 10:57, M.-A. Lemburg wrote: [SNIP] > BTW: The _codecsmodule.c file is a 4 spaces indent file as well (just > like all Unicode support source files). Someone apparently has added > tabs when adding support for Py_buffers. > It looks like this formatting mix-up is just going

[Python-Dev] error in doc for fcntl module

2009-01-07 Thread Mike Coleman
In the doc page for the fcntl module, the example below is given. This seems like an error, or at least very misleading, as the normal usage is to get the flags (F_GETFL), set or unset the bits you want to change, then set the flags (F_SETFL). A reader might think that the example below merely set

Re: [Python-Dev] Mathematica

2009-01-07 Thread Fredrik Johansson
On Wed, Jan 7, 2009 at 9:48 PM, Raymond Hettinger wrote: > Does anyone here have access to Mathematica? > I would like to know what it returns for: > > In[1]:= Permutations({a, b, c}, {5}) > > Knowing this will help resolve a feature request > for itertools.permutations() and friends. I assume yo

Re: [Python-Dev] compiling python2.5 on linux under wine

2009-01-07 Thread Luke Kenneth Casson Leighton
On Sat, Jan 3, 2009 at 9:22 PM, Luke Kenneth Casson Leighton wrote: > hey, has anyone investigated compiling python2.5 using winegcc, under wine? some people might find this kind of thing amusing. it's considered in very obtuse circles to be "progress"... :) l...@gonzalez:/mnt/src/python2.5-2

[Python-Dev] Mathematica

2009-01-07 Thread Raymond Hettinger
Does anyone here have access to Mathematica? I would like to know what it returns for: In[1]:= Permutations({a, b, c}, {5}) Knowing this will help resolve a feature request for itertools.permutations() and friends. Thanks, Raymond ___ Python-Dev ma

Re: [Python-Dev] Decoder functions accept str in py3k

2009-01-07 Thread Guido van Rossum
OK, ignore my previous comment. Sounds like the inidividual codecs need to tighten their type checking though -- perhaps *that* can be fixed in 3.0.1? I really don't see why any codec used to convert between text and bytes should support its output type as input. --Guido On Wed, Jan 7, 2009 at 10

Re: [Python-Dev] a few strdup() questions...

2009-01-07 Thread Martin v. Löwis
> MS Windows CE doesn't provide strdup(), so where should I put it? I guess I > should just compile in Python/strdup.c, right? Right. > However, where should I declare it? I recommend pyport.h. > Also, there is HAVE_STRDUP. I would actually expect that #undef HAVE_STRDUP > would do the trick

Re: [Python-Dev] Decoder functions accept str in py3k

2009-01-07 Thread M.-A. Lemburg
On 2009-01-07 19:32, Antoine Pitrou wrote: > M.-A. Lemburg egenix.com> writes: >> No, that's something I explicitly readded to Python 3k, since the >> codecs interface is independent of the input and output types (the >> codecs decide which combinations to support). > > But why would the utf8 dec

Re: [Python-Dev] Decoder functions accept str in py3k

2009-01-07 Thread Antoine Pitrou
M.-A. Lemburg egenix.com> writes: > > No, that's something I explicitly readded to Python 3k, since the > codecs interface is independent of the input and output types (the > codecs decide which combinations to support). But why would the utf8 decoder accept unicode as input?

Re: [Python-Dev] Decoder functions accept str in py3k

2009-01-07 Thread Aahz
On Wed, Jan 07, 2009, Antoine Pitrou wrote: > Guido van Rossum python.org> writes: >> >> Sounds like yet another remnant of the old philosophy, which indeed >> supported encode and decode operations on both string types. > > How do we go for fixing it? Is it ok to raise a TypeError in 3.0.1? T

Re: [Python-Dev] Decoder functions accept str in py3k

2009-01-07 Thread M.-A. Lemburg
On 2009-01-07 16:34, Guido van Rossum wrote: > Sounds like yet another remnant of the old philosophy, which indeed > supported encode and decode operations on both string types. :-( No, that's something I explicitly readded to Python 3k, since the codecs interface is independent of the input and o

Re: [Python-Dev] Decoder functions accept str in py3k

2009-01-07 Thread Benjamin Peterson
On Wed, Jan 7, 2009 at 9:46 AM, Guido van Rossum wrote: > A -3 warning should be added to 2.6 about this too IMO. A Py3k warning when attempting to decode a unicode string? Wouldn't that open the door to adding warnings to everywhere a unicode string is used where a byte string is? I thought that

[Python-Dev] Pybots link obsolete?

2009-01-07 Thread Antoine Pitrou
Hello, In http://www.python.org/dev/buildbot/, there's a link suggesting to visit the pybots Web site for more information. However, http://www.pybots.org/ just says "Nothing here #". Regards Antoine. ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Decoder functions accept str in py3k

2009-01-07 Thread Guido van Rossum
That depends a bit on how much code we find that breaks as a result. If you find you have to do a big cleanup in the stdlib after that change, it's likely that 3rd party code could have the same problem, and I'd be reluctant. I'd be okay with adding a warning in that case. OTOH if there's no cleanu

Re: [Python-Dev] Decoder functions accept str in py3k

2009-01-07 Thread Antoine Pitrou
Guido van Rossum python.org> writes: > > Sounds like yet another remnant of the old philosophy, which indeed > supported encode and decode operations on both string types. How do we go for fixing it? Is it ok to raise a TypeError in 3.0.1? ___ Pyth

Re: [Python-Dev] Decoder functions accept str in py3k

2009-01-07 Thread Guido van Rossum
Sounds like yet another remnant of the old philosophy, which indeed supported encode and decode operations on both string types. :-( On Wed, Jan 7, 2009 at 5:39 AM, Antoine Pitrou wrote: > Hello, > > I've just noticed that in py3k, the decoding functions in the codecs module > accept str objects

Re: [Python-Dev] a few strdup() questions...

2009-01-07 Thread Daniel Stutzbach
On Wed, Jan 7, 2009 at 5:30 AM, Ulrich Eckhardt wrote: > MS Windows CE doesn't provide strdup(), so where should I put it? I guess I > should just compile in Python/strdup.c, right? > I'm not an expert on Windows CE, but I believe it calls the function "_strdup()": http://msdn.microsoft.com/en-

[Python-Dev] Decoder functions accept str in py3k

2009-01-07 Thread Antoine Pitrou
Hello, I've just noticed that in py3k, the decoding functions in the codecs module accept str objects as well as bytes: # import codecs # c = codecs.getdecoder('utf8') # c('aa') ('aa', 2) # c('éé') ('éé', 4) # c = codecs.getdecoder('latin1') # c('aa') ('aa', 2) # c('éé') ('éé', 4) I

[Python-Dev] a few strdup() questions...

2009-01-07 Thread Ulrich Eckhardt
Greetings! MS Windows CE doesn't provide strdup(), so where should I put it? I guess I should just compile in Python/strdup.c, right? However, where should I declare it? My approach would be to declare it in PC/pyconfig.h. I see that RISCOS also seems to lack that function, which is why it is