Re: [Python-Dev] Object creation hook

2007-01-24 Thread Kristján V. Jónsson
ational Purify set up on my machine and then I'll maybe be able to understand the crash case better. Cheers, Kristján -Original Message- From: "Martin v. Löwis" [mailto:[EMAIL PROTECTED] Sent: 23. janúar 2007 23:32 To: Kristján V. Jónsson Cc: 'python-dev@python.org&#

[Python-Dev] Object creation hook

2007-01-23 Thread Kristján V. Jónsson
Hello there. I am trying to insert a hook into python enabling a callback for all just-created objects. The intention is to debug and find memory leaks, e.g. by having the hook function insert the object into a WeakKeyDictionary. I have already added a method to "object" to set such a hook, and

Re: [Python-Dev] valgrind

2006-11-07 Thread Kristján V . Jónsson
You want to disable the obmalloc module when using valgrind, as I have when using Rational Purify. obmalloc does some evil stuff to recocnize its memory. You also want to disable it so that you get verification on a per-block level. Actually, obmalloc could be improved in this aspect. Similar co

Re: [Python-Dev] PATCH submitted: Speed up + for string Re: PATCHsubmitted: Speed up + for string concatenation, now as fast as "".join(x) idiom

2006-10-18 Thread Kristján V . Jónsson
Doesn't it end up in a call to PyString_Concat()?  That should return a PyStringConcatenationObject too, right? K Construct like s = a + b + c + d + e , where a, b etc. have been assigned string values earlier will not benefit from the patch. __

Re: [Python-Dev] Promoting PCbuild8 (Was: Python 2.5 performance)

2006-10-17 Thread Kristján V . Jónsson
; -Original Message- > From: "Martin v. Löwis" [mailto:[EMAIL PROTECTED] > Sent: 16. október 2006 19:38 > To: Kristján V. Jónsson > Cc: Anthony Baxter; python-dev@python.org > Subject: Re: [Python-Dev] Promoting PCbuild8 (Was: Python 2.5 > performance) > > Kris

Re: [Python-Dev] Python 2.5 performance

2006-10-16 Thread Kristján V . Jónsson
006 21:13 > To: python-dev@python.org > Cc: Martin v. Löwis; Kristján V. Jónsson > Subject: Re: [Python-Dev] Python 2.5 performance > > On Friday 13 October 2006 07:00, Martin v. Löwis wrote: > > Kristján V. Jónsson schrieb: > > > This is an improvement of another 3.5

Re: [Python-Dev] Python 2.5 performance

2006-10-16 Thread Kristján V . Jónsson
Well, it ought to be possible. I can turn off the instrumentation on the other modules, and see what happens. K > -Original Message- > From: Giovanni Bajo [mailto:[EMAIL PROTECTED] > Sent: 12. október 2006 20:30 > To: Kristján V. Jónsson > Cc: python-dev@python.or

[Python-Dev] Python 2.5 performance

2006-10-12 Thread Kristján V . Jónsson
Hello there. I just got round to do some comparative runs of 2.5 32 bit Release, built with visual studio 2003 and 2005.   Here the figures (pybench with default arguments)   .NET 2003: Test minimum  average  operation  overhead-

[Python-Dev] 2.5, 64 bit

2006-10-09 Thread Kristján V . Jónsson
the VisualStudio8 64 bit build of 2.5 doesn't compile clean.  We have a number of warnings of truncation from 64 bit to 32: Often it is a question of doing an explicit cast, but sometimes we are using "int" for results from strlen and such.   Is there any interest in fixing this up?   Cheer

Re: [Python-Dev] PATCH submitted: Speed up + for string concatenation, now as fast as "".join(x) idiom

2006-10-09 Thread Kristján V . Jónsson
This patch looks really nice to use here at CCP. Our code is full of string contcatenations so I will probably try to apply the patch soon and see what it gives us in a real life app. The floating point integer cache was also a big win. Soon, standard python won't be able to keep up with the

Re: [Python-Dev] Caching float(0.0)

2006-10-04 Thread Kristján V . Jónsson
Hm, doesn´t seem to be so for my regular python. Python 2.3.3 Stackless 3.0 040407 (#51, Apr 7 2004, 19:28:46) [MSC v.1200 32 bi t (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> x = -0.0 >>> y = 0.0 >>> x,y (0.0, 0.0) >>> maybe it is 2.3.3, or mayb

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Kristján V . Jónsson
OTECTED] > On Behalf Of [EMAIL PROTECTED] > Sent: 3. október 2006 00:54 > To: Terry Reedy > Cc: python-dev@python.org > Subject: Re: [Python-Dev] Caching float(0.0) > > > Terry> "Kristján V. Jónsson" <[EMAIL PROTECTED]> wrote: > >> Anyw

Re: [Python-Dev] Caching float(0.0)

2006-10-02 Thread Kristján V . Jónsson
v. Löwis" [mailto:[EMAIL PROTECTED] > Sent: 2. október 2006 14:37 > To: Kristján V. Jónsson > Cc: Bob Ippolito; python-dev@python.org > Subject: Re: [Python-Dev] Caching float(0.0) > > Kristján V. Jónsson schrieb: > > I can't see how this situation is any different

Re: [Python-Dev] Caching float(0.0)

2006-10-02 Thread Kristján V . Jónsson
f karma lies that way? Cheers, Kristján > -Original Message- > From: "Martin v. Löwis" [mailto:[EMAIL PROTECTED] > Sent: 2. október 2006 13:50 > To: Kristján V. Jónsson > Cc: Bob Ippolito; python-dev@python.org > Subject: Re: [Python-Dev] Caching float(0.0) >

Re: [Python-Dev] Caching float(0.0)

2006-09-30 Thread Kristján V . Jónsson
Well, a lot of extension code, like ours use PyFloat_FromDouble(foo); This can be from vectors and stuff. Very often these are values from a database. Integral float values are very common in such case and id didn't occur to me that they weren't being reused, at least for small values. Also,

Re: [Python-Dev] Caching float(0.0)

2006-09-29 Thread Kristján V . Jónsson
int) fval; if ((double)i == fval && i>=-1 && i<6) { Py_INCREF(table[i]); return table[i]; } Cheers, Kristján > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > On Behalf Of Kristján V. Jónsson > Sent: 29.

Re: [Python-Dev] Caching float(0.0)

2006-09-29 Thread Kristján V . Jónsson
Acting on this excellent advice, I have patched in a reuse for -1.0, 0.0 and 1.0 for EVE Online. We use vectors and stuff a lot, and 0.0 is very, very common. I'll report on the refcount of this for you shortly. K > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTE

[Python-Dev] Unicode Imports

2006-09-07 Thread Kristján V . Jónsson
Hello All. I just added patch 1552880 to sourceforge.  It is a patch for 2.6 (and 2.5) which allows unicode paths in sys.path and uses the unicode file api on windows. This is tried and tested on 2.5, and backported to 2.3 and is currently running on clients in china and esewhere.  It is m

Re: [Python-Dev] Error while building 2.5rc1 pythoncore_pgo on VC8

2006-08-31 Thread Kristján V . Jónsson
I see.  There is a file, called pythoncore_pgo_link.txt where you have to add the object too.   But pythoncore_pgo is a bit broken in other ways at the moment.  I am working on making it better in the trunk. (I also think that MS should improve their tools to make PGO building a one step pro

Re: [Python-Dev] Error while building 2.5rc1 pythoncore_pgo on VC8

2006-08-31 Thread Kristján V . Jónsson
Hello all. I am working on updating the PCBuild8 directory in the trunk. This should fix this issue, unify platform builds for win32, x64 and I64, and provide better support for PGO builds. Hopefully when this is checked in, I can backport it to 2.5, since PCBuild8 is not an "official" platform

Re: [Python-Dev] unicode hell/mixing str and unicode as dictionarykeys

2006-08-04 Thread Kristján V . Jónsson
The "string" isn´t necessarily text, so selecting latin-1 doesn´t help (in fact, what happens is that the current default encoding is used, in his case this was ascii). What if it is image data? What if you are using a dict to implement a singleton set for arbitrary objects? The point is tha

Re: [Python-Dev] Proposal to eliminate PySet_Fini

2006-06-30 Thread Kristján V . Jónsson
> > That was a purely altruistic proposal. I've already > discovered that sets are finalized and that some code that > works with dict emulating a set may not work with a set. It > will not make much difference for me if my proposal will be > implemented in 2.6 or even in 3.0, but the soo

Re: [Python-Dev] Python 2.4 extensions require VC 7.1?

2006-06-20 Thread Kristján V . Jónsson
Actually, I was looking at the 1989 standard which is what we are supposed to be using, right? But the exact wording in 99 is: "If the request can be honored, the signal function returns the value of func for the most recent successful call to signal for the specified signal sig. Otherwise, a

Re: [Python-Dev] unicode imports

2006-06-19 Thread Kristján V . Jónsson
something I will have to patch in for our application. Cheers, Kristján -Original Message- From: Nick Coghlan [mailto:[EMAIL PROTECTED] Sent: 19. júní 2006 13:46 To: Kristján V. Jónsson Cc: "Martin v. Löwis"; Python Dev Subject: Re: [Python-Dev] unicode imports Kristján V. Jón

[Python-Dev] PyString_FromFormat

2006-06-19 Thread Kristján V . Jónsson
One thing I have often lamented having in PyString_FromFormat (and cousins, like PyErr_Format) is to be able to integrate PyObject pointers.  Adding something like %S and %R (for str() and repr() respectively) seems very useful to me.  Is there any reason why this isn´t there?   Cheers,   Kr

Re: [Python-Dev] unicode imports

2006-06-19 Thread Kristján V . Jónsson
To: Kristján V. Jónsson Cc: Python Dev Subject: Re: [Python-Dev] unicode imports Kristján V. Jónsson wrote: > The standard install path in chinese distributions can be with a > non-ANSI path, and installing an embedded python application there > will break it. I very much doubt this.

Re: [Python-Dev] unicode imports

2006-06-19 Thread Kristján V . Jónsson
trary directory. Kristján -Original Message- From: Neil Hodgson [mailto:[EMAIL PROTECTED] Sent: 17. júní 2006 04:53 To: Kristján V. Jónsson Cc: Python Dev Subject: Re: [Python-Dev] unicode imports Kristján V. Jónsson: > Although python has had full unicode support for filenames for

Re: [Python-Dev] unicode imports

2006-06-19 Thread Kristján V . Jónsson
#x27;C:\\PyDev25\\lib', 'C:\\PyDev25\\lib\\plat-win', 'C:\\PyDev25\\lib\\lib-tk', 'C:\\PyDev25\\PCbuild8 ', 'C:\\PyDev25', 'C:\\PyDev25\\lib\\site-packages'] Default encoding: ascii Input encoding: cp850 Output encodings: cp850 cp850 -Ori

Re: [Python-Dev] unicode imports

2006-06-19 Thread Kristján V . Jónsson
of source files, but I cannot write "kristján = 1". But that's for a future PEP. Kristján -Original Message- From: Nick Coghlan [mailto:[EMAIL PROTECTED] Sent: 16. júní 2006 15:30 To: Kristján V. Jónsson Cc: Python Dev Subject: Re: [Python-Dev] unicode imports Kristján

Re: [Python-Dev] Python 2.4 extensions require VC 7.1?

2006-06-19 Thread Kristján V . Jónsson
crosoft. (And by the way, why does pythoncore.dll mess with signal() anyway? shouldn´t that be python.exe? I don´t want a dll that I embed to mess with my signal handling) Cheers, Kristján -Original Message- From: "Martin v. Löwis" [mailto:[EMAIL PROTECTED] Sent: 17. j

Re: [Python-Dev] Python 2.4 extensions require VC 7.1?

2006-06-19 Thread Kristján V . Jónsson
This is, in fact, exactly what the python trunk does right now. This is done in exceptions.c Kristján -Original Message- From: Scott Dial [mailto:[EMAIL PROTECTED] Sent: 17. júní 2006 12:54 To: Python Dev Cc: "Martin v. Löwis"; Kristján V. Jónsson Subject: Re: [Python-Dev]

Re: [Python-Dev] Python 2.4 extensions require VC 7.1?

2006-06-17 Thread Kristján V . Jónsson
I remember you voicing this point at the Texas sprint. I can't say I agree. The behaviour of certain function (like signal and fopen) is undefined for certain arguments. Undefined is undefined, exiting the program with an admonition is one of the possible outcomes (as is formatting your hard

[Python-Dev] unicode imports

2006-06-16 Thread Kristján V . Jónsson
Greetings!   Although python has had full unicode support for filenames for a long time on selected platforms (e.g. Windows), there is one glaring deficiency:  It cannot import from paths containing unicode.  I´ve tried creating folders with chinese characters and adding them to path, to no

[Python-Dev] file()

2006-06-12 Thread Kristján V . Jónsson
I notice that file() throws an IOError when it detects an invalid mode string.  Wouldn't a ValueError be more appropriate? Kristján ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: htt

Re: [Python-Dev] beta1 coming real soon

2006-06-09 Thread Kristján V . Jónsson
Thanks for the reminder. What I intend to add is to finalize the PCBuild8 directory, and fix CRT runtime error handling for VC8. The change as proposed involves adding macros around a select few CRT calls (fopen, strftime, etc) where user supplied parameters are passed to the CRT innards. Code w

Re: [Python-Dev] How to fix the buffer object's broken char buffersupport

2006-06-07 Thread Kristján V . Jónsson
As a side note, It always seemed to me that the bf_getcharbuffer´s semantics were poorly defined. At least in the 2.3 documentation. Has that, and the need for it, changed recently? Kristján -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brett Cannon

Re: [Python-Dev] [Python-checkins] Python Regression Test Failuresrefleak (1)

2006-06-07 Thread Kristján V . Jónsson
Right, it is a FILETIME in the API, but the resolution stored on disk is limited to what the disk format provides. FAT32 is particularly skinny. I imagine that the value to store comes from GetSystemTimeAsFileTime which is updated with the clock interrupt. K -Original Message- From: [