Re: [Python-Dev] Simplify the file-like-object interface

2005-09-13 Thread Andrew Durdin
On 9/6/05, Antoine Pitrou [EMAIL PROTECTED] wrote: One could use class decorators. For example if you want to define the method foo() in a file-like class, you could use code like: I like the sound of this. Suppose there were a function textstream() that decorated a file-like object

Re: [Python-Dev] Replacement for print in Python 3.0

2005-09-13 Thread Andrew Durdin
On 9/6/05, Guido van Rossum [EMAIL PROTECTED] wrote: My hypothesis is that there are actually only two use cases that matter enough to be supported directly: (a) quickly print a bunch of items with spaces in between them and a trailing newline (b) print one or more items with precise

Re: [Python-Dev] Python code.interact() and UTF-8 locale

2005-09-13 Thread Hye-Shik Chang
On 9/11/05, Victor STINNER [EMAIL PROTECTED] wrote: Hi, I found a bug in Python interactive command line (program python alone: looks to be code.interact() function in code.py). With UTF-8 locale, the command ué returns u'\xc3\xa9' and not u'\xE9' . Remember: the french e with acute is

Re: [Python-Dev] Python code.interact() and UTF-8 locale

2005-09-13 Thread Hye-Shik Chang
On 9/13/05, Hye-Shik Chang [EMAIL PROTECTED] wrote: On 9/11/05, Victor STINNER [EMAIL PROTECTED] wrote: I found a bug in Python interactive command line (program python alone: looks to be code.interact() function in code.py). With UTF-8 locale, the command ué returns u'\xc3\xa9' and

Re: [Python-Dev] Replacement for print in Python 3.0

2005-09-13 Thread Calvin Spealman
On 9/9/05, Guido van Rossum [EMAIL PROTECTED] wrote: While I laugh at the naive view of people who write things like Interface equality and neutrality would be a good thing in the language and seriously (? I didn't see a smiley) use this argument to plead for not making print() a built-in, I

Re: [Python-Dev] Simplify the file-like-object interface

2005-09-13 Thread Calvin Spealman
On 9/13/05, Andrew Durdin [EMAIL PROTECTED] wrote: On 9/6/05, Antoine Pitrou [EMAIL PROTECTED] wrote: One could use class decorators. For example if you want to define the method foo() in a file-like class, you could use code like: I like the sound of this. Suppose there were a function

Re: [Python-Dev] Simplify the file-like-object interface

2005-09-13 Thread Michael Chermside
Andrew Durdin writes: Another area where I think this approach can help is with the text/binary file distinction. file() could always open files as binary, and there could be a convenience function textfile(name, mode) which would simply return textstream(file(name, mode)). This would remove

[Python-Dev] IDLE development

2005-09-13 Thread Arthur
Moam writes - Hello, More than a year and a half ago, I posted a big patch to IDLE which adds support for completion and much better calltips, along with some other improvements. I had also tried to have a little input to the IDLE development process. Suggesting on the idle-dev list it seemed

Re: [Python-Dev] Simplify the file-like-object interface

2005-09-13 Thread Paul Moore
On 9/13/05, Michael Chermside [EMAIL PROTECTED] wrote: In unix, the above is true. One of the fundamental decisions in Unix was to treat all files (and lots of other vaguely file-like things) as undiferentiated streams of bytes. But this is NOT true on many other operating systems. It is not,

Re: [Python-Dev] Simplify the file-like-object interface

2005-09-13 Thread Bill Janssen
This [text/binary] distinction is supported by the basic file operations in the C library. To open a text file in binary mode is technically an error (although in many OSs you'll get away with it). It's one of those technical errors that really isn't an error (from Python). On the other

[Python-Dev] speeding up list append calls

2005-09-13 Thread Neal Norwitz
Tim made me do it! http://groups.google.com/group/comp.lang.python/msg/9075a3bc59c334c9 For whatever reason, I was just curious how his code could be sped up. I kept seeing this append method being called and I thought, there's an opcode for that. What happens if you replace var.append()