Re: Vista 64 + Python2.5 + wxpython 28 issue

2007-06-28 Thread Martin v. Löwis
> Is there any 64 version installer or do I need to build myself ? There are hardly AMD64 versions of *anything* but the base Python distribution. I strongly advise to use the 32-bit version on AMD64 (in fact, I see little reason to run Win64 at all unless you have more that 4GiB in the box, or un

Re: Vista 64 + Python2.5 + wxpython 28 issue

2007-06-29 Thread Martin v. Löwis
> There was no need for me to use 64 so I have switched back to 32 and works > fine. > > Python is not ready for the 64 world yet ;) It's a matter of standpoint. 64 bit is not ready for the world, yet. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: How to uninstall packages

2007-07-01 Thread Martin v. Löwis
> So now my question: How does one uninstall *cleanly* > > 1> a package installed using setup.py install > 2> a package installed with easy_install Run "setup.py install" with the --record option; then remove all files that have been recorded as installed. This is clean depending on the packag

Re: shelve crashing under Win ME

2007-07-01 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > OK, here's my workaround for shelve -- it's primitive and obviously > much slower (it saves the entire dictionary each time), and you have > to manually save -- BUT: it works...even on the Win ME machine. And > it's possibly more universally portable in the long run tha

Re: Python app as a Display Manager

2007-07-01 Thread Martin v. Löwis
> I feel at this stage that what I miss is: assuming I manage to get a > python-based dialog box started automatically from init.rc (instead of xdm, > gdm, ...): how do I start an X11 session with the user/pw information > retrieved ... + set the correct *nix environment variables. First, the user

Re: object references/memory access

2007-07-01 Thread Martin v. Löwis
> I have searched a good deal about this topic and have not found > any good information yet. It seems that the people asking all want > something a bit different than what I want and also don't divulge much > about their intentions. I wish to improve the rate of data transfer > between two pyt

Re: object references/memory access

2007-07-01 Thread Martin v. Löwis
> b) use a single Python server (possibly shared with the database >process), and connect this to Apache through the >reverse proxy protocol. Following up to myself: Instead of using a reverse proxy, you can also implement the FastCGI protocol in the server. Regards, Martin -- http://mai

Re: object references/memory access

2007-07-01 Thread Martin v. Löwis
> If this is a Linux server, it might be possible to use the SCM_RIGHTS > message to pass the socket between processes. I very much doubt that the OP's problem is what he thinks it is, i.e. that copying over a local TCP connection is what makes his application slow. > That would require a > patch

Re: object references/memory access

2007-07-01 Thread Martin v. Löwis
> I guess now I'd like to know what are good practices in general to get > better results with sockets on the same local machine. I'm only > instantiating two sockets total right now - one client and one server, > and the transfer is taking 15 seconds for only 8.3MB. It would be good if you had sh

Re: unicode

2007-07-01 Thread Martin v. Löwis
> 1) If you print a unicode string: > > *print implicitly calls str()* No. print does nothing if the object is already a string or unicode object, and calls str() only otherwise. > a) str() calls encode(), and encode() tries to convert the unicode > string to a regular string. encode() uses the

Re: unicode

2007-07-01 Thread Martin v. Löwis
> ooops. I mean is that the same as print calling > u_str.encode(sys.stdout.encoding)? Almost. It's rather u_str.encode(sys.stdout.encoding or sys.getdefaultencoding()) (in case sys.stdout.encoding isn't set) Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: object references/memory access

2007-07-02 Thread Martin v. Löwis
>>> I have found the stop-and-go between two processes on the same machine >>> leads to very poor throughput. By stop-and-go, I mean the producer and >>> consumer are constantly getting on and off of the CPU since the pipe >>> gets full (or empty for consumer). Note that a producer can't run at >>>

Re: object references/memory access

2007-07-03 Thread Martin v. Löwis
> If the problem does not require two way communication, which is > typical of a producer-consumer, it is a lot faster to allow P to fully > run before C is started. Why do you say it's *a lot* faster. I find that it is a little faster. The only additional overhead from switching forth and back be

Re: import mysteries

2007-07-03 Thread Martin v. Löwis
> Yeah, of course. I just don't think anything that perverse is > happening in these cases. Take, for another example, > http://trac.edgewall.org/ticket/5646#comment:3 [that perverse == putting a name into globals()] When you do gettext.install(...), it will put the name _ into the __builtins__

Re: login http://cheeseshop.python.org/pypi broken ?

2007-07-04 Thread Martin v. Löwis
gert schrieb: > tried reseting password but i can not login anymore to upload my new > source code ? Please try again. It was a misconfiguration which should be fixed now. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing a read only attribute

2007-07-06 Thread Martin v. Löwis
> root = Tk() > > # save call address > original_tk_call = root.tk.call > > # disable tcl command execution (this is the read-only attribute) > root.tk.call = tk_dummy_call > > ... some code ... > > # restore tcl command execution > root.tk.call = original_tk_call > > > My goal is to make ins

Re: Unicode problem

2007-07-07 Thread Martin v. Löwis
> I agree, but the problem is much subtle. I have coverted a text from > iso-8859-1 to utf-8 and the codecs have translated \x27 ( the iso > apostrophe ) to \xe28099 in utf-8 ( or u'2019' in unicode code point > notation ) What software did you use to make that so? The Python codec certainly never

Re: PyXML not installing?

2007-07-09 Thread Martin v. Löwis
> error: Python was built with Visual Studio 2003; > extensions must be built with a compiler than can generate compatible > binaries. > Visual Studio 2003 was not found on this system. If you have Cygwin > installed, > you can try compiling with MingW32, by passing "-c mingw32" to > setup.py. > >

Re: Error when trying to write unicode xml to zipfile

2007-07-10 Thread Martin v. Löwis
> Unless, obviously, you were serialising to a non-utf8 encoding. But since the > "toxml()" method seems to return unicode here (which sounds surprising), I > expect it a) to provide no XML declaration at all or b) to be broken anyway. Or c) the user forgot to specify the encoding= parameter in to

Re: Implementaion of random.shuffle

2007-07-16 Thread Martin v. Löwis
>> 2**19937 being a really huge number, it's impossible to exhaust the >> Mersenne twister by running it in sequence. > > "Impossible"? Unfeasible. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Interpreting os.lstat()

2007-07-19 Thread Martin v. Löwis
> (a) Running 'stat' is *not the same* as a system call. Why do you say that? It is *exactly* the same, at least on a POSIX system (on Windows, there is no stat, so the implementation has to map that to several system calls). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Interpreting os.lstat()

2007-07-20 Thread Martin v. Löwis
> But it obviously does a lot of other stuff, including formatting > the results of the system call for display. It most decisively does *not* format the results of the system call "for display". Instead, it converts the C data type holding the stat result into a Python data type. That data type

Re: Interpreting os.lstat()

2007-07-21 Thread Martin v. Löwis
> Absolutely, which is why I consider it foolish for the OP to be > trying to deduce the meaning of os.stat by looking at the output > of the stat program, rather than studying the man page for the > stat system call. Ah, ok. I missed that the OP had brought stat(1) into the discussion. Now it's a

Re: Sorting dict keys

2007-07-22 Thread Martin v. Löwis
> I'd like to do it in one line because what I am trying to do is, after > all, a single, simple enough action. I find the suggested > b = sorted(a.keys()) much more readable than breaking it up in two > lines. I think you have demonstrated that a single-line statements with multiple functions a

Re: unicode and __repr__()

2007-04-19 Thread Martin v. Löwis
Martin Drautzburg schrieb: > I am using UTF-8 and assembling the string expression > manually works okay and the umlaute appear correctly in the browser (so > I could probably write my own serializer and it would work). That's what you should do. Or you can use one that people have already written

Re: Better dict of dicts

2007-04-19 Thread Martin v. Löwis
Bill Jackson schrieb: > I have a dictionary of dictionaries where the keys are typically very > long tuples and repeated in each inner dictionary. What I don't understand here: you say the keys are tuples, yet later, you show that the keys are strings. Which one is it? > The dictionary > represe

Re: Better dict of dicts

2007-04-19 Thread Martin v. Löwis
> Now suppose there is little overlap between the keys for the outer > dictionary and the inner dictionaries...but still much overlap between > the various inner dictionaries. Then, there is no point in using an > intern function for the outer dictionary, but still a benefit for the > inner dictio

Re: Python's handling of unicode surrogates

2007-04-19 Thread Martin v. Löwis
> Thoughts, from all you readers out there? For/against? See PEP 261. This things have all been discussed at that time, and an explicit decision against what I think (*) your proposal is was taken. If you want to, you can try to revert that decision, but you would need to write a PEP. Regards,

Re: Python's handling of unicode surrogates

2007-04-20 Thread Martin v. Löwis
> I don't believe this specific variant has been discussed. Now that you clarify it: no, it hasn't been discussed. I find that not surprising - this proposal is so strange and unnatural that probably nobody dared to suggest it. > s[5] does not exist. You would get an IndexError indicating that i

Re: service for file monitoring

2007-04-20 Thread Martin v. Löwis
> well i tried reading that but that way i'll have to make the program > monitor each and every directory. > when a file is created or deleted or filename modified , a call must > be made to the os kernel . > isn't there any way i can utilize that with any api or package > functions so that i can m

Re: python style guide inconsistencies

2007-04-22 Thread Martin v. Löwis
Darren Dale schrieb: > I was just searching for some guidance on how to name packages and modules, > and discovered some inconsistencies on the www.python.org. > http://www.python.org/doc/essays/styleguide.html says "Module names can be > either MixedCase or lowercase." That page also refers to PEP

Re: Python's handling of unicode surrogates

2007-04-22 Thread Martin v. Löwis
> IMHO what is really needed is a bunch of high level methods like > .graphemes() - iterate over graphemes > .codepoints() - iterate over codepoints > .isword() - check if the string represents one word > etc... This doesn't need to come as methods, though. If anybody wants to provide a library wi

Re: Python's handling of unicode surrogates

2007-04-22 Thread Martin v. Löwis
> The Unicode standard doesn't require that you support surrogates, or > any other kind of character, so no you wouldn't be lying. There is the notion of Unicode implementation levels, and each of them does include a set of characters to support. In level 1, combining characters need not to be sup

Re: python style guide inconsistencies

2007-04-22 Thread Martin v. Löwis
> I have the impression that tradition will change in 3.0 and your preference > realized. > Wrong? or have you not been following? I have not been following, so this might be the case. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: conditional print statement ?

2007-04-25 Thread Martin v. Löwis
Stef Mientki schrieb: > hello, > > > As part of a procedure I've a number sequences like this: > > > if Print_Info: print Datafile.readline() > else:Datafile.readline() > > > Is there a more compressed way to write such a statement, > especially I dislike the redundanc

Re: Coding conventions for class names

2007-04-26 Thread Martin v. Löwis
Kay Schluehr schrieb: > set, int, float, list, object,... > > Don't see any of the basic types following the capitalized word > convention for classes covered by PEP 08. These aren't classes, they are types. PEP 8 doesn't specify any convention for types; it is common to either apply the convent

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-26 Thread Martin v. Löwis
> I'm a bit fuzzy on this, but I don't think there _is_ a > practical way to "return memory to the OS" in many OSes. That's not true at all. Most C libraries these days manage to return memory to the operating system. On Win32 (which the OP is most likely to use), the operating system offers the

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-26 Thread Martin v. Löwis
> The moment I close the application that launched the macro, my > ressources get freed. > > So is there a way to free my memory inside my nested loops? Yes. Most likely, it is your algorithm itself which is flawed (not Python, not the application that embeds Python): You keep, most likely, refer

Re: Command-line option equiv of PYTHONPATH

2007-04-26 Thread Martin v. Löwis
> The '-I' option adds the path to the list of directories that > contains modules that can be included in a script. I can use it as "#!/ > usr/bin/perl -I" thereby not asking the user of > the script to set the in their environment. > > Is there any equivalent command-line option to the python b

Re: Command-line option equiv of PYTHONPATH

2007-04-27 Thread Martin v. Löwis
>> Why not just modify sys.path within the actual script? > > Maybe because he has multiple versions of modules he wants to test his > script against. See the original post: 'I can use it as "#!/usr/bin/perl -I"' so clearly his intention is modify the script. Martin -- http://mail.python.org/m

Re: building _tkinter module with .NET 2005?

2007-04-27 Thread Martin v. Löwis
> The instructions contained in both these readme.txt files say that the > Tcl, Tk, and Tix projects must be built from the command line first, > using nmake.exe in conjunction with the corresponding makefile.vc for > each package. I can get this to work using .NET 2003, but not > with .NET 2005. I

Program runs in all directories, except one..

2007-04-28 Thread Theo v. Werkhoven
Goodday, Something strange going on here. A piece of code I wrote bombs out in one of de directories under $HOME, but not in others. Here's a snipped: #v+ def bin2asc(c): s='' for i in range(0,8): if c & 1<<(7-i): s+='1' else:

Re: Program runs in all directories, except one..

2007-04-28 Thread Theo v. Werkhoven
The carbonbased lifeform John Machin inspired comp.lang.python with: > On Apr 28, 9:50 pm, "Theo v. Werkhoven" <[EMAIL PROTECTED] > werkhoven.nl.invalid> wrote: >> Goodday, >> >> strg = array("B",octarray).tostring() > > The

Re: Program runs in all directories, except one..

2007-04-28 Thread Theo v. Werkhoven
The carbonbased lifeform Carsten Haese inspired comp.lang.python with: > On Sat, 2007-04-28 at 13:50 +0200, Theo v. Werkhoven wrote: >> Goodday, >> >> Something strange going on here. >> A piece of code I wrote bombs out in one of de directories under $HOME, >> bu

Re: Tracebacks for `exec`ed code?

2007-04-29 Thread Martin v. Löwis
Adam Atlas schrieb: > Is it possible to make more traceback information available for > exceptions code dynamically run via `exec`? Normally it just says > things like "File '', line 3, in ?", which is not very > helpful. I'm looking for a way for it to show the line of source code > below it, like

Re: Asynchronous XML-RPC client library?

2007-04-29 Thread Martin v. Löwis
Jarek Zgoda schrieb: > Is there anything like that? Googling yields many articles on async > servers, but virtually nothing on clients. I have to talk to remote in > an environment that does not allow threads... My recommendation would be to use xmlrpclib, and combine it with the async framework t

Re: Why are functions atomic?

2007-05-01 Thread Martin v. Löwis
> I know I could use a 'functor' defining __call__ and using member > variables, but this is more complicated and quite a bit slower. (I > also know that I can use new.function to create a new copy, but I > would like to know the rational behind the decision to make functions > atomic before I sho

Re: Why are functions atomic?

2007-05-01 Thread Martin v. Löwis
Michael schrieb: > A bit more info, but still no clear picture about why functions are > mutable but have immutable copy symantics. There are arguments why > functions should be immutable, but the decision was to make user- > defined functions mutable. My question is still: why the present > ummu

Re: Why are functions atomic?

2007-05-02 Thread Martin v. Löwis
>> The answer is really really simple. The implementation of copy predates >> mutability. When the copy code was written, functions *were* immutable. >> When functions became mutable, the copy code was not changed, and >> nobody noticed or complained. > > That's probably an indication that mut

Re: Why are functions atomic?

2007-05-02 Thread Martin v. Löwis
>> The answer is really really simple. The implementation of copy predates >> mutability. When the copy code was written, functions *were* immutable. >> When functions became mutable, the copy code was not changed, and >> nobody noticed or complained. > > Likely scenario, but not true. Interestin

Re: Tcl-tk 8.5?

2007-05-02 Thread Martin v. Löwis
> Any plan to integrate Tcl 8.5 in standard Python? Sure: once Tcl 8.5 is released, it will be integrated with the next major version of Python. That might be Python 2.6, 3.0, 3.1,... depending on how long it takes to release Tcl 8.5. In any case, "integration" is necessary only for binary releas

Re: hp 11.11 64 bit python 2.5 build gets error "import site failed"

2007-05-02 Thread Martin v. Löwis
> "import site failed" > OverflowError: signed integer is greater than the maximum. > > > This is happening in the convertsimple() routine when it tries to > return a signed int: > > ival = PyInt_AsLong(arg) > > the ival is larger than what is defined in INT_MAX. > > Why is this happening in a

Re: How to check if a string is empty in python?

2007-05-02 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > How to check if a string is empty in python? > if(s == "") ?? Exactly so. "not s" works as well. Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: hp 11.11 64 bit python 2.5 build gets error "import site failed"

2007-05-03 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > I am on a hp 11.11 machine doing a 64 bit python 2.5 build. When I get > my python executable created and run it, I get the error: > > "import site failed" > OverflowError: signed integer is greater than the maximum. Are you sure about the error message? That error is

Re: hp 11.11 64 bit python 2.5 build gets error "import site failed"

2007-05-03 Thread Martin v. Löwis
>>> "import site failed" >>> OverflowError: signed integer is greater than the maximum. >> - what is the value of ival? > ival: 4294967295 I see. This is 0x, which would be -1 if it were of type int. So perhaps some value got cast incorrectly at some point, breaking subsequent computation

Re: Python regular expressions just ain't PCRE

2007-05-05 Thread Martin v. Löwis
> Are there any plans to support these features in re? This question is impossible to answer. I don't have such plans, and I don't know of any, but how could I speak for the hundreds of contributors to Python world-wide, including those future contributors which haven't contributed *yet*. Do you

Re: FIXED: [EMAIL PROTECTED]

2007-05-06 Thread Martin v. Löwis
> """ > Error... > > There's been a problem with your request > > psycopg.ProgrammingError: ERROR: could not serialize access due to > concurrent update > > delete from browse_tally > """ If that happens, just try again. I don't know how to fix it, but if you retry, it should work. Regards,

Re: getmtime differs between Py2.5 and Py2.4

2007-05-07 Thread Martin v. Löwis
> Is this a bug? Why don't you read the responses posted earlier? John Machin replied (in <[EMAIL PROTECTED]>) that you are mistaken: There is NO difference between the outcome of os.path.getmtime between Py2.5 and Py2.4. It always did return UTC, and always will. Regards, Martin -- http://mail

Re: getmtime differs between Py2.5 and Py2.4

2007-05-07 Thread Martin v. Löwis
1 test_os.diff 1 File(s) 3.661 bytes 0 Dir(s) 5.595.955.200 bytes free Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >

Re: getmtime differs between Py2.5 and Py2.4

2007-05-08 Thread Martin v. Löwis
>> that you are mistaken: There is NO difference between the outcome >> of os.path.getmtime between Py2.5 and Py2.4. It always did return >> UTC, and always will. > > Different results are indeed obtained, as others have demonstrated > (other than the irrelevant float/int distinction). The follow

Re: getmtime differs between Py2.5 and Py2.4

2007-05-08 Thread Martin v. Löwis
> the difference (rounding to an int number of seconds) is just about one > hour; in certain parts of the world (Europe and Africa), that could > indeed be a timezone issue. With the help of Tony Meyer, we rediscovered the explanation: because of a bug in the Microsoft C run-time library, the UTC

Re: Windows, subprocess.Popen & encodage

2007-05-08 Thread Martin v. Löwis
> But, I don't found anything, in any documentations, on this. > > Sombody can confirm? Am I misled? Am I right? You are right, and you are misled. The encoding of the data that you get from Popen.read is not under the control of Python: i.e. not only you don't know, but Python doesn't know, e

Re: Another easy pair of questions

2007-05-08 Thread Martin v. Löwis
> In a python Tk shell in Windows, what is the equivalent of unix's pwd? os.getcwd() > In a python Tk shell in Windows, is there an easy way to reoeat an > earlier command, similar to Tcl/Tk's hist? Press the cursor-up key. Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about file handles and windows handles @ Windows Operating Systems

2007-05-08 Thread Martin v. Löwis
> Are there any function to get windows handle of file which is already > opened with built-in file-function. mscvrt.get_osfhandle HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: psycopg2 error

2007-05-08 Thread Martin v. Löwis
> ImportError: libpq.so.5: cannot open shared object file: No such file or > directory > > libpq files are readable by the world: [EMAIL PROTECTED] pgsql # ll lib/ -d > drwxr-xr-x 3 postgres postgres 1528 2007-05-07 23:25 lib/ Don't try this as the root user, but as the one for whom it is failing

Re: how to refer to partial list, slice is too slow?

2007-05-10 Thread Martin v. Lo
人言落日是天涯,望极天涯不见家 schrieb: > I'm a python newbie. It seems the slice operation will do copy. > for example: a = [1,2,3,4,5,6,7,8,9,0] b = a[7:] b > [8, 9, 0] a.remove(9) a > [1, 2, 3, 4, 5, 6, 7, 8, 0] b > [8, 9, 0] > > if the list have large members, the slice operatio

Re: SQLObject 0.9.0

2007-05-10 Thread Martin v. Löwis
> For reasons others will know, there are different branches to the > SQLObject project. I think, analogously, python still has an active 2.4 > branch, if that helps make sense of maintaining branches based on > versions. I'm not sure why the announcements aren't bundled into one > because just abo

Re: How to find C source

2007-05-10 Thread Martin v. Löwis
Gabriel Genellina schrieb: > En Thu, 10 May 2007 21:47:39 -0300, <[EMAIL PROTECTED]> escribió: > >> How do I get to the source for parser.suite()? > > Are you looking for function parser_suite in parsermodule.c? To give some URL for convenience: http://svn.python.org/projects/python/trunk/Modul

Re: Thread-safe dictionary

2007-05-12 Thread Martin v. Löwis
> - in __getitem__, does it release the lock after returning the item? Yes, it does. > - wouldn't it be better to use threading.RLock, mutex, ... instead? Better in what sense? Performance-wise? Semantically? Performance-wise, the best thing would be to do safe_dict = dict because the builtin

PEP 3131: Supporting Non-ASCII Identifiers

2007-05-13 Thread Martin v. Löwis
Regards, Martin PEP: 3131 Title: Supporting Non-ASCII Identifiers Version: $Revision: 55059 $ Last-Modified: $Date: 2007-05-01 22:34:25 +0200 (Di, 01 Mai 2007) $ Author: Martin v. Löwis <[EMAIL PROTECTED]> Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 1-May-2007 Pyt

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-13 Thread Martin v. Löwis
> The only objection that comes to mind is that adding such support may > make some distinct identifiers visually indistinguishable. IIRC the DNS > system has had this problem, leading to much phishing abuse. This is a commonly-raised objection, but I don't understand why people see it as a probl

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-13 Thread Martin v. Löwis
> It should be noted that the Python community may use other forums, in > other languages. They would likely be a lot more enthusiastic about > this PEP than the usual crowd here (comp.lang.python). Please spread the news. Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-14 Thread Martin v. Löwis
> In <[EMAIL PROTECTED]>, Nick Craig-Wood > wrote: > >> My initial reaction is that it would be cool to use all those great >> symbols. A variable called OHM etc! > > This is a nice candidate for homoglyph confusion. There's the Greek > letter omega (U+03A9) Ω and the SI unit symbol (U+2126) Ω,

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-14 Thread Martin v. Löwis
> Not providing an explicit listing of allowed characters is inexcusable > sloppiness. That is a deliberate part of the specification. It is intentional that it does *not* specify a precise list, but instead defers that list to the version of the Unicode standard used (in the unicodedata module).

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-14 Thread Martin v. Löwis
Neil Hodgson schrieb: > Paul Rubin wrote: >>> Plenty of programming languages already support unicode identifiers, >> >> Could you name a few? Thanks. > >C#, Java, Ecmascript, Visual Basic. Specification-wise, C99 and C++98 also support Unicode identifiers, although many compilers still don

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-14 Thread Martin v. Löwis
Paul Rubin schrieb: >> Plenty of programming languages already support unicode identifiers, > > Could you name a few? Thanks. The GNU assembler also supports non-ASCII symbol names on object file formats that support it; this includes at least ELF (not sure about PE32). Higher-level programming

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
>PEP 3131 uses a similar definition to C# except that PEP 3131 > disallows formatting characters (category Cf). See section 9.4.2 of > http://www.ecma-international.org/publications/standards/Ecma-334.htm UAX#31 discusses formatting characters in 2.2, and recognizes that there might be good re

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
> Now look me in the eye and tell me that you find > the mix of proper German and English keywords > beautiful. I can't admit that, but I find that using German class and method names is beautiful. The rest around it (keywords and names from the standard library) are not English - they are Python.

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
> A possible modification to the PEP would be to permit identifiers to > also include \u and \U escape sequences (as some other > languages already do). Several languages do that (e.g. C and C++), but I deliberately left this out, as I cannot see this work in a practical way. Also, it

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
> Consequently, Python's keywords and even the standard library can > exist with names being "just symbols" for many people. I already told that on the py3k list: Until a week ago, I didn't know why "pass" was chosen for the "no action" statement - with all my English knowledge, I still could not

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
> IMO, the burden of proof is on you. If this PEP has the potential to > introduce another hindrance for code-sharing, the supporters of this PEP > should be required to provide a "damn good reason" for doing so. So far, > you have failed to do that, in my opinion. All you have presented are > vagu

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
> You could say the same about Python standard library and keywords then. > Shouldn't these also have to be translated? One can even push things a > little further: I don't know about the languages used in the countries > you mention, but for example, a simple construction like 'if > ' will look w

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
>> So, please provide feedback, e.g. perhaps by answering these >> questions: >> - should non-ASCII identifiers be supported? why? > > I think the biggest argument against this PEP is how little similar > features are used in other languages and how poorly they are supported > by third party utili

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
René Fleschenberg schrieb: > Stefan Behnel schrieb: >> Then get tools that match your working environment. > > Integration with existing tools *is* something that a PEP should > consider. This one does not do that sufficiently, IMO. What specific tools should be discussed, and what specific probl

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
> In the code I was looking at identifiers were allowed to use non-ASCII > characters. For whatever reason, the programmers choose not use non-ASCII > indentifiers even though they had no problem using non-ASCII characters > in commonets. One possible reason is that the tools processing the progr

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
> After 175 replies (and counting), the only thing that is clear is the > controversy around this PEP. Most people are very strong for or > against it, with little middle ground in between. I'm not saying that > every change must meet 100% acceptance, but here there is definitely a > strong opposit

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
> However, what I want to see is how people deal with such issues when > sharing their code: what are their experiences and what measures do > they mandate to make it all work properly? You can see some > discussions about various IDEs mandating UTF-8 as the default > encoding, along with UTF-8 bei

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
> I claim that this is *completely unrealistic*. When learning Python, you > *do* learn the actual meanings of English terms like "open", > "exception", "if" and so on if you did not know them before. It would be > extremely foolish not to do so. Having taught students for many years now, I can re

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
> I'd suggest restricting identifiers under the rules of UTS-39, > profile 2, "Highly Restrictive". This limits mixing of scripts > in a single identifier; you can't mix Hebrew and ASCII, for example, > which prevents problems with mixing right to left and left to right > scripts. Domain name

Re: A bug in cPickle?

2007-05-17 Thread Martin v. Löwis
> This does seem odd, at the very least. The differences between the pn codes comes from this comment in cPickle.c: /* Make sure memo keys are positive! */ /* XXX Why? * XXX And does "positive" really mean non-negative? * XXX pickle.py starts with PUT index 0, no

Re: omissions in python docs?

2007-05-17 Thread Martin v. Löwis
7stud schrieb: > I have a hard time believing I am the first one to notice those > omissions. Are the docs just old and poorly maintained? Or, is there > some reason those methods were omitted? You are likely the first one to notice, and then talk about that. It often happened in the past that p

Re: omissions in python docs?

2007-05-17 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: >> It often happened in the past that patches were admitted which don't >> simultaneously update the documentation, hence they diverge. These >> days, patches are regularly rejected for not providing proper >> documentation changes. > > Nevertheless, the docs *ARE* old a

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
>> At the same time it takes some mental effort to analyze and understand >> all the implications of a feature, and without taking that effort >> "something" will always beat "nothing". >> > Indeed. For example, getattr() and friends now have to accept Unicode > arguments, and presumably to canonic

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
Neil Hodgson schrieb: > Martin v. Löwis: > >> ... regardless of whether this PEP gets accepted >> or not (which it just did). > >Which version can we expect this to be implemented in? The PEP says 3.0, and the planned implementation also targets that release.

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
G RIGHT ARROW ABOVE, which is of general category Mn, Mark, Nonspacing. In PEP 3131, such marks may not appear as the first character (since they need to modify a base character), but as subsequent characters. This allows you to form identifiers such as v⃗ (which should render as a small letter v,

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Martin v. Löwis
> Possibly. One Java program I remember had Japanese comments encoded > in Shift-JIS. Will Python be better here? Will it support the source > code encodings that programmers around the world expect? It's not a question of "will it". It does today, starting from Python 2.3. >> Another possible

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-19 Thread Martin v. Löwis
> Providing a method that would translate an arbitrary string into a > valid Python identifier would be helpful. It would be even more > helpful if it could provide a way of converting untranslatable > characters. However, I suspect that the translate (normalize?) routine > in the unicode module wi

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-19 Thread Martin v. Löwis
>> But you're making a strawman argument by using extended ASCII >> characters that would work anyhow. How about debugging this (I wonder >> will it even make it through?) : >> >> class 6자회담관련론조 >>6자회 = 0 >>6자회담관련 고귀 명=10 > >That would be invalid syntax since the third line is an assig

Re: Uninstall speed with Python 2.4 MSI

2007-05-19 Thread Martin v. Löwis
David Bolen wrote: > I'm in the process of uninstalling 2.4a2 to install 2.4a3 and the > uninstall is running absolutely dog slow and burning 100% cpu while > doing it (all going to mshta.exe). Watching the progress bar it > almost seems to be doing a whole bunch of operations per file or > someth

Re: fun with unicode files

2007-05-19 Thread Martin v. Löwis
Thomas Heller wrote: > I wonder: do I really have to check for the BOM manually, or is there a > Python function which does that? If it can also be ASCII (or ansi?), then yes, you need to manually check for the BOM. This is because you need to make an explicit decision in the fallback case - Pytho

<    7   8   9   10   11   12   13   14   15   16   >