Re: [Python-3000] Google Sprint Ideas

2006-08-21 Thread martin
O library will be likely 100% pure Python, this needs thought. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] [Python-Dev] What should the focus for 2.6 be?

2006-08-23 Thread martin
. are not made to gradually move towards 3.0, but because it is anticipated that 3.0 will not be adopted immediately, but, say, 3.2 might be. To provide new features for 2.x users, new 2.x releases need to be made (of course, the features added to, say, 2.7 will likely also be added to, say, 3.3).

Re: [Python-3000] find -> index patch

2006-08-24 Thread martin
Zitat von Jack Diederich <[EMAIL PROTECTED]>: > +if (sep_found): This should be if sep_found: > If folks like the way this partial set looks I'll convert the rest. Otherwise, it looks fine. Martin ___ Py

[Python-3000] long/int unification

2006-08-24 Thread martin
ideas how to further improve the performance. Using a plain 32-bit int as the representation could be another try, but I somewhat doubt it helps given that the the supposedly-simpler single-digit case is so slow. Regards, Martin ___ Python-3000 mailing

Re: [Python-3000] problem with checking whitespace in svn pre-commit hook

2007-06-07 Thread martin
he EOF as the parentheses aren't balanced. > I ran reindent prior to committing, but that had no effect (ie, > still go the error). I find that hard to believe - running reindent.py on the file fails for me with Python 2.5 as well. Regards, Martin __

Re: [Python-3000] Unicode and OS strings

2007-09-20 Thread martin
's examples. True. However, this does not mean that the file names are byte strings - they are character strings in an unspecified/undetermined encoding. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mail

Re: [Python-3000] Unicode and OS strings

2007-09-21 Thread martin
t did exist, it would be characters, not bytes. "Canonical equivalents" is not a property of bytes, but of Unicode characters (code points specifically). Also, I'm not quite sure why you think the file system has to do anything with sys.argv (unless your understanding of what a "fil

Re: [Python-3000] os.popen versus subprocess.Popen

2008-04-22 Thread Martin (gzlist)
's wrong with it? Well, if you use unix, with no spaces in directories and legal 'quote', you'll probably say "nothing". String interpolating command calls makes for unnecessarily non-portable code. Now, if subprocess could only start (optionally) taking unicode argument

Re: [Python-3000] translation support feature, via extended % operators

2008-08-13 Thread Martin Geisler
k it does most of what you propose, including letting the translators write the little code snippets that will determine if it should be '1 file' or 'n files'. The gettext manual has more to say here: http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms --

Re: [Python-3000] Possible py3k problem.

2008-11-19 Thread Martin (gzlist)
e. ctypes doesn't, and if you don't, they may be garbage collected, crashing your program when a callback is made. Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://

Re: [Python-3000] StringIO vs cStringIO, pickle vs cPickle

2006-04-04 Thread Martin v. Löwis
IO's "feature" to support > unicode, right?) I believe the rationale for providing them as old-style classes also was to support inheritance. Atleast, that's what the docstring in StringIO.py says: - There's also a much faster implementation in C, called cStringIO,

Re: [Python-3000] Will we have a true restricted exec environment for python-3000?

2006-04-08 Thread Martin v. Löwis
bypass the restrictions. I don't think any of the regular contributors is interested in that kind of project. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubsc

Re: [Python-3000] Will we have a true restricted exec environmentfor python-3000?

2006-04-11 Thread Martin v. Löwis
(for acquiring the GIL out of nowhere) breaks if there are multiple interpreters. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/opti

Re: [Python-3000] Will we have a true restricted exec environmentfor python-3000?

2006-04-11 Thread Martin v. Löwis
f you used IPC. This would be similar to .NET AppDomains or Java Isolates. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

[Python-3000] Draft PEP: Module Initialization and finalization

2006-04-11 Thread Martin v. Löwis
Abstract: Module initialization currently has a few deficiencies. There is no cleanup for modules, the entry point name might give naming conflicts, the entry functions don't follow the usual calling convention, and multiple interpreters are not supported well. This PEP addresses these issues. Mod

Re: [Python-3000] symbols?

2006-04-11 Thread Martin v. Löwis
e the colon or not? - can you pass them to getattr, instead of strings? Everything else follows from this spec (I hope). Symbols compare for identity, are hashable, meant to be immutable (Bug: the specification allows for mutation; the implementation shouldn't). Regards, Martin

Re: [Python-3000] symbols?

2006-04-11 Thread Martin v. Löwis
Kendall Clark wrote: > Thanks, Martin. That is, in fact, pretty much what I'd like to see in > Py3K, modulo the issue about getattr. The question is still: why? In Smalltalk, symbols are used to denote names (methods/selector names and class names); this apparently isn't your int

Re: [Python-3000] Draft PEP: Module Initialization and finalization

2006-04-11 Thread Martin v. Löwis
get the naming right? That would also work. But, if we also have finalizers, we already need two macros to generate the function name. > It'd allow > easier changing of the naming and such in the future, but I don't know > if that outweighs the discomfort of hiding function pro

Re: [Python-3000] Draft PEP: Module Initialization and finalization

2006-04-12 Thread Martin v. Löwis
referring to it have been unloaded. So, when the DLL is unloaded, no action should be taken. I also think it's not Windows only: on dl, we should invoke dlclose when all modules have been finalized. Regards, Martin ___ Python-3000 mailing list

Re: [Python-3000] Draft PEP: Module Initialization and finalization

2006-04-12 Thread Martin v. Löwis
es should be able to > participate in cyclic GC... > > Don't they already? They have a traverse proc, just not a clear proc. Sure: for the state that is common to all modules. For the per-module state, traverse functionality might also be needed, which w

Re: [Python-3000] Adaptation vs. Generic Functions

2006-04-13 Thread Martin v. Löwis
ther. This is because they only form a partial order. Of course, it might be possible to impose a total order on top of it (e.g. giving the left-more operands higher precedence, or considering the order of registration). This all sound arbitrary, though. Regards, Martin ___

Re: [Python-3000] Use Py_CLEAR only

2006-04-23 Thread Martin v. Löwis
nge right away again, and in case a), if anybody still has a pointer to the block, we are in trouble, and clearing the pointer likely doesn't help in finding the trouble. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail

Re: [Python-3000] Unicode identifiers (Was: sets in P3K?)

2006-04-28 Thread Martin v. Löwis
nclude a requirement that the standard library would always be restricted to ASCII-only identifiers as a style-guide. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe:

Re: [Python-3000] Make it easier to port to small devices.

2006-04-28 Thread Martin v. Löwis
ut all of this could happen today if there were only contributions. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] Unicode identifiers (Was: sets in P3K?)

2006-04-28 Thread Martin v. Löwis
it plays a special role in (number) literals. More generally, there is the distinction of starter and non-starter characters. An identifier ends when the first non-identifier character is encountered (although I don't think there are many places in Python where you can have t

Re: [Python-3000] Unicode identifiers (Was: sets in P3K?)

2006-04-28 Thread Martin v. Löwis
t;, and that punctuation would have to be ASCII, as non-ASCII characters would be restricted to comments, string literals, and identifiers. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] Unicode identifiers (Was: sets in P3K?)

2006-04-29 Thread Martin v. Löwis
tend the definition of ID_Continue, not the definition of digits. > I do think that *eventually* we'll have to support this. But I don't > think Python needs to lead the pack here; I don't think the tools are > ready yet. Python doesn't really lead here. The

Re: [Python-3000] Unicode identifiers (Was: sets in P3K?)

2006-04-29 Thread Martin v. Löwis
rent: you really have to understand the intent for giving a certain API its name, because you won't be able to remember that many "non-sensical" character sequences - just as you wouldn't be able to use the API if it was written in Greek letters, with a Greek meaning. Regards, Ma

Re: [Python-3000] Unicode identifiers (Was: sets in P3K?)

2006-04-30 Thread Martin v. Löwis
st other > languages. Ok. I was only worried about your change in PEP 3099: "Python won't use Unicode characters for anything except string literals or comments." If that is only meant to say "this won't be introduced in Python 3", I'm fine with

Re: [Python-3000] Math in Python 3.0

2006-05-13 Thread Martin v. Löwis
ut I do think improved support for custom numeric types is a very > strong motivation for implementing generic functions in Python 3.0. My guess is that it isn't brought up very often because very few people have the problem you are talking about. Regards, Martin __

Re: [Python-3000] What do do about IDLE?

2006-05-13 Thread Martin v. Löwis
the CD-ROM or network installation, and that always included Tkinter (in addition to also including PyQt and others) So yes, there is no guarantee that Tkinter is installed on all systems that have Python installed (not even Windows), but no, the core dis

Re: [Python-3000] Math in Python 3.0

2006-05-13 Thread Martin v. Löwis
having the same name, and despite them giving equal results for some arguments, it doesn't feel to me that these functions should get unified. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/pyt

Re: [Python-3000] Math in Python 3.0

2006-05-13 Thread Martin v. Löwis
at sqrt function live? I hope you are not proposing it becomes a builtin - I dearly wish there were fewer builtins, not more. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubsc

Re: [Python-3000] Math in Python 3.0

2006-05-14 Thread Martin v. Löwis
sqrt(float) would cause a stack overflow for calling itself. In any case, I still wonder whether these functions should be unified when they have different semantics (e.g. when passing negative ints or floats to math.sqrt vs. cmath.sqrt). Regards, Martin __

Re: [Python-3000] [Python-Dev] Integer representation (Was: ssize_t question: longs in header files)

2006-05-29 Thread Martin v. Löwis
type into a dictionary. If the type is anonymous, they will do dispatch[type(0)] = marshal_int dispatch[type(sys.maxint+1)] = marshal_int Plus, their current code as dispatch[int] = marshal_int which will silently break (although it won't be silent if they also have dispatch[long]

Re: [Python-3000] gettype

2006-07-30 Thread Martin v. Löwis
tomer filiba schrieb: > so why not choose the "get%s()" notation? Why not o.__class__? Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.pytho

Re: [Python-3000] int-long unification

2006-08-20 Thread Martin v. Löwis
ng result; if(!PyLong_ToLong(val, &result)) Py_FatalError("old-style integer conversion failed"); return result; } Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubsc

Re: [Python-3000] Ctypes as cross-interpreter C calling interface

2006-08-20 Thread Martin v. Löwis
ilation) d) No real support for C++ (where there are even more ABI issues: (multiple) inheritance, vtables, constructors, operator overload, templates, ...) To access a C API, the only "right" way is to use a C compiler. ctypes is for people who want to avoid using a C compiler a

Re: [Python-3000] Google Sprint Ideas

2006-08-20 Thread Martin v. Löwis
layers. I even doubt that exposing writev in Python would make a measurable performance difference. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.o

Re: [Python-3000] locale-aware strings ?

2006-09-12 Thread Martin v. Löwis
Paul Prescod schrieb: > I haven't created locale-relevant content in a generic text editor in a > very, very long time. You are an atypical user, then. I use plain text files all the time, and I know other people do as well. Regards, Martin ___

Re: [Python-3000] string C API

2006-09-12 Thread Martin v. Löwis
perate on Py_UNICODE* (although we don't have literals for these) or - be removed Likewise, PyString_AsString either goes away or changes its return type. String APIs that operate on PyObject* likely can stay as-is. Regards, Martin ___ Python

Re: [Python-3000] Character Set Indepencence

2006-09-12 Thread Martin v. Löwis
know how to deal with tag characters - you could guess the language from the content, based on the frequency of characters (e.g. presence of katakana/hiragana would indicate that it is Japanese). As with all guessing, there are cases where it fai

Re: [Python-3000] locale-aware strings ?

2006-09-12 Thread Martin v. Löwis
bjects from system APIs where available (e.g. in glibc), and not provide them on systems that don't have locale objects in their APIs. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] locale-aware strings ?

2006-09-12 Thread Martin v. Löwis
, Python is going to silently misinterpret my data. No. It will use a different API to determine the system encoding, and it will guess correctly. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listi

Re: [Python-3000] encoding hell

2006-09-12 Thread Martin v. Löwis
FC-imposed requirement that each line of input is "neutral" wrt. character set switching, so you can typically synchronize at a line break. Still, this could require to skip an arbitrary amount of text. Regards, Martin ___ Python-3000 mailing

Re: [Python-3000] locale-aware strings ?

2006-09-12 Thread Martin v. Löwis
knows very well which one to use in which place. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] encoding hell

2006-09-12 Thread Martin v. Löwis
to export and import its state into such "tell objects". Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] string C API

2006-09-13 Thread Martin v. Löwis
ke integers don't remember which base they were originally represented in). Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] string C API

2006-09-13 Thread Martin v. Löwis
ainable. Start with implementing len(s). Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] string C API

2006-09-13 Thread Martin v. Löwis
have no such problem. I'm not so much worried about UTF-8 or Latin-1; they are fairly trivial. Efficiency of such methods for multi-byte encodings would be dramatically slow. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org htt

Re: [Python-3000] string C API

2006-09-14 Thread Martin v. Löwis
my objection is this: What about errors that occur in decoding? What happens if the bytes are not meaningful in the presumed encoding? ISTM that raising the exception lazily (which seems to be necessary) would be very confusing. Regards, Martin ___

Re: [Python-3000] string C API

2006-09-15 Thread Martin v. Löwis
maximum code point is, where they currently can decode in a single pass. Of course, for multi-byte codecs, such scanning is a good idea, anyway (some currently overallocate just to avoid the second pass). Regards, Martin (*) Many systems don't allow such large memory blocks,anyway. E.g.

Re: [Python-3000] string C API

2006-09-16 Thread Martin v. Löwis
Josiah Carlson schrieb: >> That places a burden on all creators of strings to ensure >> that they are in the minimal format, which could be >> inconvenient for some operations, e.g. taking a substring >> could require making an extra pass to re-code the data. > >

Re: [Python-3000] string C API

2006-09-16 Thread Martin v. Löwis
c would have to create the string of the right width; a codec written in C would make two passes, rather than temporarily allocating memory to actually represent the UCS-4 codes. Regards, Martin ___ Python-3000 mailing list Python-3000@python.

Re: [Python-3000] string C API

2006-09-16 Thread Martin v. Löwis
ptions; I'd rather debate about the necessity of one-byte and four-byte representations. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] string C API

2006-09-16 Thread Martin v. Löwis
,4). If the algorithm isn't symmetric (i.e. you can't reduce (2,1) to (1,2)), you need 9 different versions of the algorithm. That sounds more complicated than always decoding. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org

Re: [Python-3000] Kill GIL?

2006-09-17 Thread Martin v. Löwis
in Python, option 3 if it is written in C (yes, you can use multiple truly concurrent threads in Python: just release the GIL on the C level; you can't make any calls into Python until you reacquire the GIL). Regards, Martin ___ Pytho

Re: [Python-3000] Delayed reference counting idea

2006-09-18 Thread Martin v. Löwis
every cache line containing Python objects - including > functions, modules... - has to be written back when it is evicted, even > if those objects are "constant". Yes, though this is likely negligible wrt. to the overhead that locking operations on refcount cha

Re: [Python-3000] Delayed reference counting idea

2006-09-18 Thread Martin v. Löwis
ot getting the declarations of variables right, and endless bug hunts because a referenced object is already collected, and its memory overwritten. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/m

Re: [Python-3000] Delayed reference counting idea

2006-09-18 Thread Martin v. Löwis
es in constant time "on average"). Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] Kill GIL?

2006-09-19 Thread Martin v. Löwis
we" aren't going to fix it, not with Python 3.0, and likely not with any release in the foreseeable future. The only exception would be if somebody offered a reasonable solution, which "we" would just have to incorporate (and possibly mai

Re: [Python-3000] Kill GIL?

2006-09-19 Thread Martin v. Löwis
o), and the extension module globals (types, and in particular exceptions). Do you want them still to be global, or per-interpreter? Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/py

Re: [Python-3000] Delayed reference counting idea

2006-09-19 Thread Martin v. Löwis
time. Allocation is in constant time most of the time (in some applications, it's always constant). Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.pytho

Re: [Python-3000] Kill GIL?

2006-09-19 Thread Martin v. Löwis
ypes, and in particular exceptions). >> >> Do you want them still to be global, or per-interpreter? >> >> Regards, >> Martin > > It is one fixable problem among many, but fixable none-the-less. [...] Your message didn't really answer the question, did it?

Re: [Python-3000] How will unicode get used?

2006-09-23 Thread Martin v. Löwis
The former should get errors if too high of a > character is used, the latter will need conversion if we're not using > UTF-16. Define "used". Surrogate pairs work well in the NTFS of Windows NT 3.1; no errors are reported. Regards, Martin __

Re: [Python-3000] How will unicode get used?

2006-09-23 Thread Martin v. Löwis
Adam Olsen schrieb: > As far as I can tell, CPython on windows uses UTF-16 with code units. > Perhaps not intentionally, but by default (not throwing an error on > surrogates). It's intentionally; that's what PEP 261 specifie

Re: [Python-3000] How will unicode get used?

2006-09-23 Thread Martin v. Löwis
e any desire to let people understand and join > the discussion? It's clear that there should be only a single character string type, and that should be close to the current Unicode type, in semantics and implementation. Regards, Martin

Re: [Python-3000] How will unicode get used?

2006-09-23 Thread Martin v. Löwis
sistent python-level experience across platforms is a different issue. CPython could behave absolutely consistently, and use four-byte Unicode on all systems, and the length of a non-BMP string would still be implementation-defined. Regards, Martin ___ Python-30

Re: [Python-3000] How will unicode get used?

2006-09-23 Thread Martin v. Löwis
and slicing is a basic > requirement, even if it has to be done using code units. It's not possible to implement slicing in constant time, unless string views are introduced. Currently, slicing takes time linear with the length of the result string. Regards, Martin _

Re: [Python-3000] How will unicode get used?

2006-09-23 Thread Martin v. Löwis
ot;give me the data" kind would either have to expose the choice of representations, or perform a copy. Either alternative would produce many programming errors in extension modules. Regards, Martin ___ Python-3000 mailing list Python-3000@python.

Re: [Python-3000] How will unicode get used?

2006-09-24 Thread Martin v. Löwis
ementation if there is only a single internal representation. >> Either alternative would produce many programming errors in extension > > modules. > > And even if that was true (which I don't believe), "many" would still > be "very small"

Re: [Python-3000] Transitional GC?

2006-09-24 Thread Martin v. Löwis
that moving to a tracing GC will require module authors to change their code. Perhaps that isn't necessary. It is difficult to tell, in the abstract, whether your proposal works or not. Regards, Martin ___ Python-3000 mailing list Python-3000@pytho

Re: [Python-3000] How will unicode get used?

2006-09-24 Thread Martin v. Löwis
ays the right answer. In the specific case, I'm also worried about the increase in complexness. That said, it is always good to have a prototype implementation to analyse the consequences better. Regards, Martin ___ Python-3000 mailing

Re: [Python-3000] How will unicode get used?

2006-09-26 Thread Martin v. Löwis
oint is; but it's just more code, and no problem in principle. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] How will unicode get used?

2006-09-26 Thread Martin v. Löwis
efficient code > for multiple representations is mostly trivial, even in C. I wouldn't call SRE's macro trickeries "trivial", though. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mai

Re: [Python-3000] How will unicode get used?

2006-09-27 Thread Martin v. Löwis
es 2*k and 2*k+1 to find the child nodes? This would get down memory overhead significantly; you'd only need the length of the array to determine what a leaf node is. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mai

Re: [Python-3000] Pre-PEP: Easy Text File Decoding

2006-10-02 Thread Martin v. Löwis
tml#29 The BOM can also serve as an encoding marker. I refer to the BOM encoded in UTF-8 as "UTF-8 signature". As such, it is very meaningful. Usage of the BOM in UTF-8-encoded text is deliberate. Regards, Martin ___ Python-3000 mailing lis

Re: [Python-3000] BOM handling

2006-10-02 Thread Martin v. Löwis
Georg Brandl schrieb: >>>>> b = (codecs.BOM_UTF8 + "hello").decode("utf-8") >>>>> len(a) >> 5 > > This behavior is questionable... Indeed. Try py> b = (codecs.BOM_UTF8 + "hello").decode("utf-8-sig") py> le

Re: [Python-3000] BOM handling

2006-10-02 Thread Martin v. Löwis
implementation. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] BOM handling

2006-10-02 Thread Martin v. Löwis
does the interpretation. On Linux, the magic bytes that are recognized can be extended at run-time, which make the "utf8script" Debian package possible. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.pytho

Re: [Python-3000] BOM handling

2006-10-02 Thread Martin v. Löwis
g > Jennifer:~ bwinton$ ./test > -bash: ./test: cannot execute binary file This works fine in Debian if you have the "utf8script" package installed. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org ht

Re: [Python-3000] Help on text editors

2006-10-03 Thread Martin v. Löwis
is called "Program Files" in the English version (and doesn't get renamed when a MUI package is installed), and is called "Programme" in the German version. Regards, Martin ___ Python-3000 mailing list Python-3000@python.or

Re: [Python-3000] Help on text editors

2006-10-03 Thread Martin v. Löwis
anslation. In Germany, some translators now use UTF-8 for translations, as this supports the typographically correct „quotation“. gettext will automatically transliterate these if the locale does not support them. So you shouldn't use the encoding of .mo files to infer some sor

Re: [Python-3000] string C API

2006-10-03 Thread Martin v. Löwis
three? Not sure what implementors you are talking about: anybody who wants to clone Python is free to do whatever they want. We *are* the implementors of CPython, and if we don't want to do more, then we just don't want it. Regards, Martin ___

Re: [Python-3000] sys.stdin and sys.stdout with textfile

2006-10-03 Thread Martin v. Löwis
ither require to read data from a stream, nor to open a file. If we read data from a pipe, it is probably most natural to assume that the system code page/locale encoding is used for these data. Regards, Martin ___ Python-3000 mailing list Python-3000@p

Re: [Python-3000] string C API

2006-10-03 Thread Martin v. Löwis
a reasonable way. With that generality, you lose any information as to what the internal representation is, and then code becomes tedious to write and slow to run. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org

Re: [Python-3000] string C API

2006-10-03 Thread Martin v. Löwis
it slow. It's the copying of potentially large string data that a recoding requires. In addition, for some encodings, the algorithm to do the transformation is fairly slow. > I'll admit that I'm not sure what sort of data would make a real-world > (as opposed to contrived) be

Re: [Python-3000] Help on text editors

2006-10-04 Thread Martin v. Löwis
lder on disk is always called "Applications", it is rendered with a directory name of "Programme" if you use the German localization, in the OSX Finder. While it solves the problem, it is very confusing if you use shell-level interaction (the shell won't accept "Programm

Re: [Python-3000] Proposal: No more standard library additions

2006-10-14 Thread Martin v. Löwis
an one package. Define distutils features that are obsolete, and come up with a strategy of removing or replacing them. When you are done, you can come back proposing that the library should be made out of distutils packages. Regards, Martin ___ Pytho

Re: [Python-3000] Pre-PEP: Easy Text File Decoding

2006-10-14 Thread Martin v. Löwis
etting that cannot be changed). The Unix principle is often extended to reach into areas where it really becomes inadequate, look at Plan 9 for an example. Wrt. byte streams and encodings, the principle works only if all applications use the same encoding (w

Re: [Python-3000] content-based detection

2006-10-14 Thread Martin v. Löwis
and often have a BOM. I've never seen an UCS-4 file "in the wild" (except for testing, of course). Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://

Re: [Python-3000] Pre-PEP: Easy Text File Decoding

2006-10-14 Thread Martin v. Löwis
e from the "middle" (say, U+F4xx). There is a slight chance of ambiguity here if the actual input also contains such PUA characters; if you worry about this, you could escape those. For Py3k, I would like to propose a standard "binary" codec

Re: [Python-3000] Pre-PEP: Easy Text File Decoding

2006-10-14 Thread Martin v. Löwis
See RFC 2279: # Character values from to 007F (US-ASCII repertoire) # correspond to octets 00 to 7F (7 bit US-ASCII values). So U+ is represented by the octet 00. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org

Re: [Python-3000] Proposal: No more standard library additions

2006-10-14 Thread Martin v. Löwis
re modular and better documented architecture than > distutils. I definitely disagree. Why are you calling distutils non-modular? It was designed to be modular and extensible, and, indeed, it is. If it is not documented well, the solution shouldn't be to replace it, but

Re: [Python-3000] Pre-PEP: Easy Text File Decoding

2006-10-14 Thread Martin v. Löwis
existing codecs, and help to decode undecodable file names in a way that round-trips. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] Proposal: No more standard library additions

2006-10-15 Thread Martin v. Löwis
nctionality is missing in distutils (e.g. means for more transparent extension), then distutils should be enhanced to provide this functionality. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] Proposal: No more standard library additions

2006-10-15 Thread Martin v. Löwis
e()' method - changed 'get_outputs()' so it includes bytecode files A lot of the code added is very similar to code in install_lib.py; would be nice to factor it out further. Notice that it is meant to be off by default, and, indeed, for me, it is off. Not sure why you are getting .pyc files in your build directory. Regards, Martin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] Proposal: No more standard library additions

2006-10-15 Thread Martin v. Löwis
look like? How would it operate on systems other than the Mac? > Unless the basic structure is so far from what's > needed that it can't be reasonably fixed. See, and I believe this isn't the case for distutils. Regards, Martin __

Re: [Python-3000] Proposal: No more standard library additions

2006-10-15 Thread Martin v. Löwis
support for that: distutils.dep_util offers a couple of routines that do time-stamp checking. You don't have to reinvent, but you do have to specify what should happen when some file is newer than some other file. distutils cannot know this. Regards, Martin _

Re: [Python-3000] Proposal: No more standard library additions

2006-10-16 Thread Martin v. Löwis
pting to deal with it is complex, incomplete, and non-intuitive. And that statement is IMO not only true about distutils, but also about its direct competitors, and about the more-remote relatives (such as dpkg, rpm, msi, OSX packages, ...) Regards, Martin ___ Pyth

  1   2   3   4   5   6   7   8   >