Re: what does ^ do in python

2008-03-25 Thread Christian Heimes
rns 5 > 3^5 returns 6 > 5^3 returns 6 .. ^ is exclusive or (xor) # 1 ^ 1 = 0 >>> 1 ^ 1 0 # 01 ^ 10 = 11 >>> 1 ^ 2 3 # 01 ^ 11 = 10 >>> 1 ^ 3 2 # 001 ^ 100 = 101 >>> 1 ^ 4 5 Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: python hash() function

2008-03-25 Thread Christian Heimes
php. Thanks in advance. The code is in Objects/stringobject.c:string_hash() Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with -3 switch

2009-01-12 Thread Christian Heimes
e issue. The author didn't think of decoding the incoming bytes to unicode. In Python 2.x it works fine as long as the site contains ASCII only. In Python 3.0 however an error is raised because binary data is no longer implicitly converted to unicode. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with -3 switch

2009-01-12 Thread Christian Heimes
ternal text data"? "foo" and u"foo" are two totally different things. The former is a byte sequence "\x66\x6f\x6f" while the latter is the text 'foo'. It just happens that "foo" and u"foo" are equal in Python 2.x because "foo".decode("ascii") == u"foo". In Python 3.x does it right, b"foo" is unequal to "foo". Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Compressed vs uncompressed eggs

2009-01-12 Thread Christian Heimes
> Is there a, say, performance penalty in using compressed eggs? To the contrary, it can be faster to import from a zip file than from the file system. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: trying to modify locals() dictionary

2009-01-12 Thread Christian Heimes
y should not be modified; changes may not affect the values of local variables used by the interpreter. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with -3 switch

2009-01-12 Thread Christian Heimes
> I say again, show me a case of working 2.5 code where prepending u to > an ASCII string constant that is intended to be used in a text context > is actually worth the keystrokes. Eventually you'll learn it the hard way. *sigh* Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: 'Import sys' succeeds in C++ embedded code, but module is not fully visible

2009-01-13 Thread Christian Heimes
t_Insert(syspath, 0, path); Py_DECREF(syspath); Py_DECREF(path); if (result != 0) return NULL; Py_RETURN_NONE; } Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: optimizing large dictionaries

2009-01-15 Thread Christian Heimes
You can omit this alias, too. It's not required. __repr__ = __str__ Instead of the try/except clause I recommend colletions.defaultdict. Defaultdict takes one callable as factory function. Since int() returns 0 it has the same effect as your code. from collections import defaultdict elt = defaultdict(int) Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: optimizing large dictionaries

2009-01-15 Thread Christian Heimes
wn. I assume that you won't notice a slow down. However my instincts tell me that you'll hardly get a speedup, either. You have to roll your own benchmarks to study which algorithm is faster in reality. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3: range objects cannot be sliced

2009-01-16 Thread Christian Heimes
p it functionally > more similar to the old range). The old range function returned a list. If you need the old functionality you can use list(range(...))[]. Why do you want to slice a range anyway? The range type supports a start, stop and step argument. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Totally confused by the str/bytes/unicode differences introduced in Pythyon 3.x

2009-01-16 Thread Christian Heimes
--- str -> bytes unicode -> str "" -> b"" u"" -> "" HTH Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: ABCs, functions, and __call__ (Python3)

2009-01-16 Thread Christian Heimes
"__call__" attribute. In order to distinguish functions from callable you can use the inspect module, in particular inspect.isfunction(), inspect.ismethod() and inspect.isbuiltin(). Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Totally confused by the str/bytes/unicode differences introduced in Pythyon 3.x

2009-01-16 Thread Christian Heimes
so you can stick to bytes everywhere. If you didn't have to worry about encoding and unicode in Python 2.x then you should use bytes all over the place, too. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Where to place imports

2009-01-23 Thread Christian Heimes
a sub thread then you should use the C function PyImport_ImportModuleNoBlock() or use sys.modules and imp.lock_held(). Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: is None vs. == None

2009-01-23 Thread Christian Heimes
Jason Scheirer schrieb: > Yes. I know that there are the PyObject* structs defined for you > Py_True, Py_False and Py_None in the C level. Confusingly enough, the > integers -5 through 257 are also singletons where the is test will > work, but any int out of that range will not. Small ints are cac

Re: is None vs. == None

2009-01-23 Thread Christian Heimes
John Machin schrieb: > On Jan 24, 7:48 am, Roger wrote: >>> And, just for completeness, the "is" test is canonical precisely because >>> the interpreter guarantees there is only ever one object of type None, >>> so an identity test is always appropriate. Even the copy module doesn't >>> create cop

Re: Exec woes

2009-01-27 Thread Christian Heimes
quot; raises a syntax error like "help(if)" or "help(while)" would raise a syntax error, too. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: writing large dictionaries to file using cPickle

2009-01-28 Thread Christian Heimes
perfr...@gmail.com schrieb: > but this takes just as long... any ideas ? is there a different module > i could use that's more suitable for large dictionaries ? > thank you very much. Have a look at ZODB. -- http://mail.python.org/mailman/listinfo/python-list

Re: Swapping values of two variables

2009-01-30 Thread Christian Heimes
the next multiple of 8 bytes due to address alignment. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Get thread pid

2009-01-30 Thread Christian Heimes
Alejandro schrieb: > Hi: > > I have Python program running under Linux, that create several > threads, and I want to now the corresponding PID of the threads. May I ask why you want to get the TID? You can't do anything useful with it. You can't kill a thread safely, neither from within Python no

Re: is python Object oriented??

2009-01-30 Thread Christian Heimes
d example for well designed and object oriented C code. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Why do operators and methods of built-in types differ

2009-01-31 Thread Christian Heimes
The NotImplemented singleton is an optimization. The interpreter just has to compare the memory address of the returned value with the address of NotImplemented. That's a super fast op in C. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: is python Object oriented??

2009-01-31 Thread Christian Heimes
rom unmananged assemblies. Seriously, 'private' and 'protected' are merely tools to stop bad programmers from doing bad stuff. And the serve as documentation, too. Oh, by the way, the first C++ compilers just converted C++ code to C code. Such much about "You can't do

Re: Membership of multiple items to a list

2009-02-01 Thread Christian Heimes
[1,2,3]) >>> yadda = set([3,4,5,6]) >>> blah.issubset(yadda) False >>> blah.difference(yadda) set([1, 2]) >>> blah.symmetric_difference(yadda) set([1, 2, 4, 5, 6]) Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Cross platform compilation?

2009-02-03 Thread Christian Heimes
o hack all the > setup files...? I'm sorry to inform you that Python doesn't support cross platform compilation. Python eats its own dog food and uses Python to compile optional extension modules. Some guys were working on a patch. You may find something in the bug tracker at http://bugs.python.org Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: function call overhead

2009-02-03 Thread Christian Heimes
Eddie Watson schrieb: > What's the Python function call overhead like? Like 6, maybe 7 *scnr* -- http://mail.python.org/mailman/listinfo/python-list

Re: kinterbasdb + firebird 1.5 with python 2.6 ?

2009-02-03 Thread Christian Heimes
on 2.6 > > Any thoughts? kinterbasdb 3.2.2 and 3.3.0 are working perfectly fine with Python 2.6. You can install it in less than 2 minutes with the usual tar -xzf && python2.6 setup.py install dance. I don't know if the latest versions of kinterbasdb still support 1.5. Christian

Re: Python 3.0 slow file IO

2009-02-05 Thread Christian Heimes
thomasvang...@gmail.com schrieb: > I just recently learned python, I'm using it mainly to process huge > <5GB txt files of ASCII information about DNA. I've decided to learn > 3.0, but maybe I need to step back to 2.6? > > I'm getting exceedingly frustrated by the slow file IO behaviour of > pytho

Re: Ordered dict by default

2009-02-05 Thread Christian Heimes
andrew cooke schrieb: > so what is happening with pep 372? > > http://www.python.org/dev/peps/pep-0372/ It's still a draft and hasn't been implemented yet. Now is the time to get it ready for Python 3.1 and 2.7. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system issues

2009-02-05 Thread Christian Heimes
e either write "E:\\..." or r"E:\..." (note the trailing 'r'). Try this: import subprocess subprocess.check_call(['E:\\Programs\\muscle\\muscle.exe', '-in', 'filename', '-out', 'filename']) Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing return of type(obj)

2009-02-06 Thread Christian Heimes
hod call obj.method() is implemented as type(obj).method(obj). Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: How to copy an instance without its cStringIO.StringO item ?

2009-02-08 Thread Christian Heimes
ot copying the cStringIO.StringO to the > target). > > Can you suggest a better way ? You can overwrite some functions in order to omit attributes from a pickle. It's all documented at http://docs.python.org/library/pickle.html#pickling-and-unpickling-normal-class-instances Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-08 Thread Christian Heimes
e slower and require more memcopy ops. CPython has a deque implementation in the collections module with is optimized for both changing both ends of a list like object. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-08 Thread Christian Heimes
Stephen Hansen schrieb: > Now, I believe Python sets *are* for all intents and purposes > dictionaries, but I think that's just because its the easiest and most > efficient way to implement their uniqueness properties; they took the > very-well-tuned dictionary implementation and cut out the stuff

Re: thread. question

2009-02-09 Thread Christian Heimes
API. Google for "GIL" if you are interested in more information. > Does that also mean that there is very little extra interpreter-overhead > to using locks (assuming they very infrequently block)? Since if you use > the thread module direct the code doesn't seem to esca

Re: Calling into Python from a C thread

2009-02-09 Thread Christian Heimes
ster you thread with Python. You need to deal with PyThread_init_thread(), PyEval_InitThreads(), PyThreadState_New(), PyThreadState_Clear() and PyThreadState_DeleteCurrent(). The module Modules/threadmodule.c contains some examples. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: thread. question

2009-02-09 Thread Christian Heimes
Tim Wintle schrieb: > Thanks for both replies, > > On Mon, 2009-02-09 at 15:59 +0100, Christian Heimes wrote: >> You shouldn't use the thread module directly. It's not meant to be used >> by a user. Please stick to the threading module. You won't notice a >&

Re: Calling into Python from a C thread

2009-02-09 Thread Christian Heimes
embedding.html should explain how and when to initialize Python threads. Please report a documentation bug at http://bugs.python.org/. Christian PS: I know a great way to learn more about Python's internal threading CAPI: fix your code, test it and attach a doc patch to your bug report. *hint* :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Escaping my own chroot...

2009-02-11 Thread Christian Heimes
less the process drops it's root privileges with setuid() ASAP the process can escape the chroot'ed environment, too. chroot() can help with increasing security but it's not bullet proof. By the way it's a bad idea to mount proc and sys inside a chroot ... Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Can I 'LOOK' through urllib?

2009-02-11 Thread Christian Heimes
upports the desired feature. Are you able to teach your webserver WebDAV by any chance? All major HTTP server have plugins for WebDAV. Christian [1] http://en.wikipedia.org/wiki/Webdav -- http://mail.python.org/mailman/listinfo/python-list

Re: A little bit else I would like to discuss

2009-02-12 Thread Christian Heimes
n. We are following the same path here. Nobody is going to stop you from creating a large bundle of useful extensions as long as you follow the licenses. In fact lots of people may appreciate a bundle. But the Python core package will always stay small and agile. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: is there a project running (GUI Builder for Python ) ?

2009-02-12 Thread Christian Heimes
or Microsoft products. >> >> wx on the other hand is cross platform and ergo, much more >> complicated. >> > > I think that WX is really great but there is really a great lack of a > builder. This isn't a Python problem - really. Please discuss your issu

Re: A little bit else I would like to discuss

2009-02-12 Thread Christian Heimes
on > > I guess that would mean *a lot* maintenance overhead so that will > probably never. We considered to remove optional software from the core like the email package, TCL/TK and more. Eventually we decided against it for various reasons. For one we don't have the resources to maintain additional packages. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem building Python extension

2009-02-13 Thread Christian Heimes
eah, you installed the C# environment. Python is written in C, so you have to get Visual Studio C++ 2008. However a recent version of MinGW32 is sufficient to build most extensions. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: *nix tail -f multiple log files with Thread

2009-02-13 Thread Christian Heimes
g multiple file descriptors. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Easier to wrap C or C++ libraries?

2009-02-14 Thread Christian Heimes
> architectures, nor does it work when Python is built with non-gcc Unix > compilers ctypes works on 64bit systems, too. However it's a pain in the ... back to write code with ctypes that works across all platforms. I used to use ctypes for wrapper but eventually I switched to Cython. Chr

Re: Pythonic way to determine if a string is a number

2009-02-15 Thread Christian Heimes
loat( input ) > else: > num = int( input ) > return True > > except ValueError: > return False You code doesn't check for several float representations like "1e10", "1E10", "inf" and "nan". Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

2009-02-15 Thread Christian Heimes
r building 2.5.4 (./configure CFLAGS=-fPIC , as the error message > suggests), ld still croaks here: How about compiling Python as a shared library? ./configure --enable-shared does the trick. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way to determine if a string is a number

2009-02-15 Thread Christian Heimes
> except: >is_an_int = False Please don't teach new Python developers to use bare excepts. In fact never use bare excepts at all! Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way to determine if a string is a number

2009-02-15 Thread Christian Heimes
reset() Do you really want to except SystemExit, KeyboardInterrupt, MemoryError and SyntaxError? Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: printing bytes to stdout in Py3

2009-02-17 Thread Christian Heimes
ut, or close sys.stdout and reopen it in 'b' > mode, or dup(fd) it first, or whatever the right thing to do is ? The official API to write binary data to stdout is: >>> count = sys.stdout.buffer.write(b"abc\n") abc Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: memory recycling/garbage collecting problem

2009-02-17 Thread Christian Heimes
memory management system on top of the system's malloc() system. The memory arena system is explained in great detail in the file obmalloc.c [2]. Christian [1] http://en.wikipedia.org/wiki/Malloc#Implementations [2] http://svn.python.org/view/python/branches/release25-maint/Objects/obmall

Re: memory recycling/garbage collecting problem

2009-02-17 Thread Christian Heimes
Tim Wintle wrote: > Basically malloc() and free() are computationally expensive, so Python > tries to call them as little as possible - but it's quite clever at > knowing what to do - e.g. if a list has already grown large then python > assumes it might grow large again and keeps hold of a percenta

Re: Will multithreading make python less popular?

2009-02-17 Thread Christian Heimes
ly increase the speed of your computer. It's going to take at least half a decade until the tools for multi core development are working properly and reliable. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: printing bytes to stdout in Py3

2009-02-17 Thread Christian Heimes
Traceback (most recent call last): File "", line 1, in UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0: unexpected code byte Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Threads vs. processes, what to consider in choosing ?

2009-02-17 Thread Christian Heimes
ters a lot. For instance, will the > processing code write its results to a database, ping the GUI code and > then exit, allowing the GUI to read the database? That sounds like an > excellent setup for processes. A backport for Python 2.4 and 2.5 is available on pypi. Python 2.5.4 is recomm

Re: printing bytes to stdout in Py3

2009-02-17 Thread Christian Heimes
Casey schrieb: > On Feb 17, 12:33 pm, Christian Heimes wrote: >> Yes, it's really the official way. You can google up the discussion >> between me and Guido on the python-dev list if you don't trust me. ;) >> The docs concur with me, too. >> >>

Re: "Maximum recursion depth exceeded"...why?

2009-02-17 Thread Christian Heimes
if(filename.endswith("html") or filename.endswith("htm")): > print filename Why so complicated? for root, dirs, files in os.walk(directory): for filename in files: if filename.endswith((".htm"), (".html")): print os.path.join(root, filename) Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: _socket.so source?

2009-02-17 Thread Christian Heimes
(VC7.1), for Python 2.6 and 3.0 you have to install Visual Studio 2008 (VC9). The code for the _socket extension is in the Modules/ subdirectory of the source tree. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: "Maximum recursion depth exceeded"...why?

2009-02-17 Thread Christian Heimes
You have to os.path.join(dir, file) to get an absolute path. Anyway stop reinventing the wheel and use os.walk() as I already explained. You can easily spot the depth with "directory.count(os.sep)". os.path.normpath() helps you to sanitize the path before counting the number of os.sep. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: "Maximum recursion depth exceeded"...why?

2009-02-17 Thread Christian Heimes
ot.count(os.sep) for root, dirs, files in os.walk(base): level = root.count(os.sep) - baselevel offset = level * "../" ... See? Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Building python with sqlite3

2009-02-18 Thread Christian Heimes
did not find any > options relating with sqlite3 of configure and Makefile. Do you have the development files installed as well? Run "make" again and look at the list of missing modules. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Will multithreading make python less popular?

2009-02-19 Thread Christian Heimes
..] non-trivial multi-threaded programs are incomprehensible for humans. HTH Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Explanation for trailing comma in example from Learning Python?

2009-02-19 Thread Christian Heimes
Carl Schumann wrote: > I could see the logic in always or never having a trailing comma. What > I don't understand here is why only the single element case has a > trailing comma. Any explanations please? Does this code shad some light on the trailing comma? :) >>> (1) == 1 True >>> (1,) == 1

Re: Will multithreading make python less popular?

2009-02-19 Thread Christian Heimes
a Python program can wrap a library and use as many cores as possible. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Will multithreading make python less popular?

2009-02-19 Thread Christian Heimes
Mensanator wrote: > I thought of that, but the usual Windows crap accounts for only a > couple percent prior to the Python program running. Christian Heimes > answer sounds more realistic. > > But what do I know? Be happy that your program makes use of both cores? :] You ca

Re: Killing subservient threads

2009-02-20 Thread Christian Heimes
inate became true) threading.Condition() and threading.Event() are especially designed for the job. Please use them appropriately. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Find the location of a loaded module

2009-02-20 Thread Christian Heimes
7;t be in the module search path. > > When I tell Python to load a module, is there a way to tell which > directory the module was loaded from? All except builtin modules have an attribute __file__ that points to the file. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Using clock() in threading on Windows

2009-02-20 Thread Christian Heimes
osal seems sensible. A trivial patch should solve the issue: from time import sleep as _sleep if _sys.name == "win32": from time import clock as _time else: from time import time as _time However I'm not sure about the implications. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: "Byte" type?

2009-02-21 Thread Christian Heimes
e > 2.6 as > defective. Please don't call something dumb that you don't fully understand. It's offenses the people who have spent lots of time developing Python -- personal, unpaid and voluntary time! I can assure, the bytes alias and b'' alias have their right to exist. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: "Byte" type?

2009-02-22 Thread Christian Heimes
Hendrik van Rooyen wrote: > "Christian Heimes" wrote: > >> John Nagle wrote >>>If "bytes", a new keyword, works differently in 2.6 and 3.0, that was >>> really >>> dumb. There's no old code using "bytes". So conver

Re: Reference or Value?

2009-02-22 Thread Christian Heimes
value, lists and dicts by reference. > > Is there a general rule? Some common formulation? Python uses neither call by reference nor call by value. It's called call by sharing or call by object. http://effbot.org/zone/call-by-object.htm Christian -- http://mail.python.org/mailman/listinfo/python-list

And now for something completely different ...

2008-11-22 Thread Christian Heimes
To whom it might concern. Monty Python has opened an official Monty Python channel on Youtube. http://www.youtube.com/user/MontyPython High quality Monty Python movies - powered by Python :) Have fun! Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-23 Thread Christian Heimes
s this attribute gone in 3.0rc3 ? where is this documented ? It's now os.path.extsep. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: No complex rationals in Python 3.0

2008-11-24 Thread Christian Heimes
y which isn't suited for the Python core. It's written in C++ and it's licensed under GPL. Neither GPL nor LGPL software can't be integrated into the core. We also require all code to be compatible with C89. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: 'new' module deprecation in python2.6

2008-11-29 Thread Christian Heimes
e new style classes with type: >>> Name = type("Name", (object,), dict(spam="egg")) >>> Name >>> Name.spam 'egg' Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: building an extension module with autotools?

2008-12-03 Thread Christian Heimes
Gerhard Häring wrote: #!/bin/sh python setup.py build cp build/lib.*/*.so . python test.py "python setup.py build_ext -i" is your friend. It installs the extensions inplace. No need for cp here. :) Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3 read() function

2008-12-04 Thread Christian Heimes
ent.split ( 'BIN;SP1;PW0.3,1;PA100,700;PD625,700;PU;' ) # This one i have neve tried... [/code] Do you really mean io.StringIO? I guess you want io.BytesIO() .. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3 read() function

2008-12-04 Thread Christian Heimes
g was so slow because the fileio_readall() was increasing the buffer by 8kB in each iteration. The new code doubles the buffer until it reaches 512kB. Starting with 512kB it's increased in 512kB blocks. Python 2.x has the same growth rate. Christian -- http://mail.python.org/mailman/listi

Re: slow Python 3.0 write performance?

2008-12-05 Thread Christian Heimes
;ll get the fix in the next release of Python 3.0 in a couple of weeks. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: slow Python 3.0 write performance?

2008-12-05 Thread Christian Heimes
MRAB wrote: Does pysco with with Python 3.0 (the homepage says 2.5)? If it does then that might help! :-) No, it won't help. -- http://mail.python.org/mailman/listinfo/python-list

Re: slow Python 3.0 write performance?

2008-12-06 Thread Christian Heimes
caused by additional code for line ending detection and decoding/encoding. The new io library does more than the old file object So far the new io library hasn't been optimized yet, too. Please give it some time and report speed issues at http://bugs.python.org/. Christian -- http://mail.pyt

Re: dict subclass and pickle bug (?)

2008-12-07 Thread Christian Heimes
tstate__(self, state): dict.update(self, state[0]) self.__dict__.update(state[1]) def __reduce__(self): state = (dict(self), self.__dict__) return (__newobj__, (self.__class__,), state) Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: StringIO in 2.6 and beyond

2008-12-08 Thread Christian Heimes
2.6/io.py", line 1487, in write s.__class__.__name__) TypeError: can't write str to text stream which has me stumped. Why can't it? In this context 'str' means Python 3.0's str type, which is unicode in 2.x. Please report the misleading error message. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: python3.0 - any hope it will get faster?

2008-12-09 Thread Christian Heimes
.1. There are interesting experiments with LLVM and threaded code (not to confuse with multithreading) going on. Grüße an die andere Seite von Aachen Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: broken ncurses on python 3.0

2008-12-11 Thread Christian Heimes
binaries doesn't have and never had an ncurses extension. The extension doesn't suport ncurses on Windows at all - in all versions of Python. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way of debigging a C extension

2008-12-11 Thread Christian Heimes
ay of doing things might be useful. I'll see what I can put together based on the responses I get here. http://svn.python.org/view/python/branches/release25-maint/PCbuild/readme.txt?rev=51333&view=auto Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way of debigging a C extension

2008-12-11 Thread Christian Heimes
e. The compiler rearranges the code. You could try to compile your own code with different compiler arguments. I don't know if that's easily possible on Windows with Python 2.5. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way of debigging a C extension

2008-12-11 Thread Christian Heimes
, > as that's what will be easy for most people to set up. A debug build changes large parts of the ABI. Every PyObject struct gains additional fields, lots of checks are added to Python's memory allocation system and asserts are enabled. Debug extensions have a _d suffix for a very good

Re: Python is slow

2008-12-12 Thread Christian Heimes
*is* slower for now. As I already said in another thread our top priorities were feature completeness and bug fixing. Optimizations will follow the features in the near future. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Dictionary Algorithm Question

2008-12-16 Thread Christian Heimes
me insights. Make your you read dictnotes.txt and the cmments in dictobject.c http://svn.python.org/view/python/branches/release25-maint/Objects/ Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.maxint in Python 2.6.1 (amd64) on Windows XP x64

2008-12-16 Thread Christian Heimes
t 32 bit but usually sizeof(ptr). Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess returncode windows

2008-12-16 Thread Christian Heimes
t;, "--host mydomain", "--port 4848", "--user admin", "server-01"]) That should solve your quoting issues on Windows and fix your code. shell=True is considered evil and should be avoided whenever possible. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.maxint in Python 2.6.1 (amd64) on Windows XP x64

2008-12-16 Thread Christian Heimes
oo. It depends on the file system. It works with NTFS but I'm not sure how FAT32 deals with large files. My DVB-S receiver with USB port chokes on files with more than 2 GB. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: getting object instead of string from dir()

2008-12-17 Thread Christian Heimes
element, the answer > is always string. How do I point at the variables themselves. A > quick example is: > > a = 5 > b = 2.0 > c = 'c' > > lst = dir() > > for el in lst: > print type(el) for name, obj in vars().iteritems(): print name, obj Chris

Re: New Python 3.0 string formatting - really necessary?

2008-12-19 Thread Christian Heimes
.0. For that very reason it must stay until 3.2. We don't have plans to deprecate it in 3.1 so it will stay at least until Python 3.3 which is to be released about 2014. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: New Python 3.0 string formatting - really necessary?

2008-12-19 Thread Christian Heimes
ally different truth than mine -- and most of the active member of the community. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: New Python 3.0 string formatting - really necessary?

2008-12-21 Thread Christian Heimes
ted a few more months or even a few more years with a 3.0 release. There is always - I repeat ALWAYS - work to do. For an open source project like Python "release early, release often" works better. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: no sign() function ?

2008-12-22 Thread Christian Heimes
Pierre-Alain Dorange schrieb: > I don't find any sign(x) function in the math library (return the sign > of the value). > I've read that math module is a wrapper to C math lib and that C math > lib has not sign(), so... Starting with Python 2.6 the math and cmath modules have a copysign function.

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