Re: [Python-Dev] The other Py2.4 issue

2004-12-10 Thread Armin Rigo
Hi, On Fri, Dec 10, 2004 at 12:06:01PM +, Paul Moore wrote: For most C extensions, the best free option is mingw. Sorry, I was not aware that mingw supports the new VC7.1-type of runtime that is needed for the extension module to load with the official Python 2.4 distribution. Note that

[Python-Dev] Re: [Python-checkins] python/dist/src/Python marshal.c, 1.79, 1.80

2004-12-20 Thread Armin Rigo
Hi! A single-character diff... On Mon, Dec 20, 2004 at 04:25:59AM -0800, [EMAIL PROTECTED] wrote: --- marshal.c 27 Jun 2004 16:51:46 - 1.79 +++ marshal.c 20 Dec 2004 12:25:57 - 1.80 @@ -893,7 +893,7 @@ { PyObject *x; int version = Py_MARSHAL_VERSION; -

Re: [Python-Dev] Re: [Python-checkins] python/dist/src/Pythonmarshal.c, 1.79, 1.80

2004-12-22 Thread Armin Rigo
Hi Tim, On Tue, Dec 21, 2004 at 05:21:29PM -0500, Tim Peters wrote: we reverted to repr/eval, which is quite slower (and actually not guaranteed to work across Python versions either: string escapes sometimes change). Really? The precise rules str's __repr__ uses for which escapes to

Re: [Python-Dev] Build extensions for windows python 2.4 what are the compiler rules?

2004-12-24 Thread Armin Rigo
Hi, On Fri, Dec 24, 2004 at 12:17:49AM +, Barry Scott wrote: I recursive grep'ed and missed this ref. However I did read this in README.TXT: The extending and embedding tutorial is similarily out-of-date. Armin ___ Python-Dev mailing list

[Python-Dev] Upcoming PyPy sprint

2004-12-25 Thread Armin Rigo
). A bientot, Armin Rigo ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: getting special from type, not instance (was Re: [Python-Dev] copy confusion)

2005-01-13 Thread Armin Rigo
Hi Guido, On Wed, Jan 12, 2005 at 09:59:13AM -0800, Guido van Rossum wrote: The descriptor for __getattr__ and other special attributes could claim to be a data descriptor This has the nice effect that x[y] and x.__getitem__(y) would again be equivalent, which looks good. On the other hand, I

Re: [Python-Dev] PEP 246: lossless and stateless

2005-01-14 Thread Armin Rigo
Hi Guido, On Thu, Jan 13, 2005 at 10:20:40PM -0800, Guido van Rossum wrote: Hm. Maybe that post points out that adapters that add state are bad, period. I have to say that the example of adapting a string to a file using StringIO() is questionable. Another possible adaptation from a string to

Re: [Python-Dev] PEP 246: lossless and stateless

2005-01-14 Thread Armin Rigo
Hi Phillip, On Fri, Jan 14, 2005 at 10:22:36AM -0500, Phillip J. Eby wrote: Note that this is solvable in practice by the author of a method or framework choosing to define an interface that they accept, and then pre-defining the adaptation from string to that interface. So, what a string

Re: [Python-Dev] Exceptions *must*? be old-style classes?

2005-01-17 Thread Armin Rigo
Hi, On Fri, Jan 14, 2005 at 07:20:31PM -0500, Jim Jewett wrote: The base of the Exception hierarchy happens to be a classic class. But why are they required to be classic? For reference, PyPy doesn't have old-style classes at all so far, so we had to come up with something about exceptions.

Re: [Python-Dev] Exceptions *must*? be old-style classes?

2005-01-17 Thread Armin Rigo
Hi Guido, On Mon, Jan 17, 2005 at 07:27:33AM -0800, Guido van Rossum wrote: That is stricter than classic Python though -- it allows the value to be anything (and you get the value back unadorned in the except 's', x: clause). Thanks for the note ! Armin

Re: [Python-Dev] PEP 246: lossless and stateless

2005-01-18 Thread Armin Rigo
Hi Clark, On Fri, Jan 14, 2005 at 12:41:32PM -0500, Clark C. Evans wrote: Imagine enhancing the stack-trace with additional information about what adaptations were made; Traceback (most recent call last): File xxx, line 1, in foo Adapting x to File File yyy,

Re: [Python-Dev] Getting rid of unbound methods: patch available

2005-01-20 Thread Armin Rigo
Hi, Removing unbound methods also breaks the 'py' lib quite a bit. The 'py.test' framework handles function and bound/unbound method objects all over the place, and uses introspection on them, as they are the objects defining the tests to run. It's nothing that can't be repaired, and at

Re: [Python-Dev] builtin_id() returns negative numbers

2005-02-17 Thread Armin Rigo
Hi Tim, On Mon, Feb 14, 2005 at 10:41:35AM -0500, Tim Peters wrote: # This is a puzzle: there's no way to know the natural width of # addresses on this box (in particular, there's no necessary # relation to sys.maxint). Isn't this natural width nowadays available as:

Re: [Python-Dev] can we stop pretending _PyTyple_Lookup is internal?

2005-03-14 Thread Armin Rigo
Hi Michael, ... _PyType_Lookup ... There has been discussions about copy_reg.py and at least one other place in the standard library that needs this; it is an essential part of the descriptor model of new-style classes. In my opinion it should be made part not only of the official C API but

Re: [Python-Dev] longobject.c ob_size

2005-04-04 Thread Armin Rigo
Hi Michael, On Sun, Apr 03, 2005 at 04:14:16PM +0100, Michael Hudson wrote: Asking mostly for curiousity, how hard would it be to have longs store their sign bit somewhere less aggravating? As I guess your goal is to get rid of all the if (size 0) size = -size in object.c and friends, I

Re: [Python-Dev] New style classes and operator methods

2005-04-11 Thread Armin Rigo
Hi Greg, On Fri, Apr 08, 2005 at 05:03:42PM +1200, Greg Ewing wrote: If the left and right operands are of the same class, and the class implements a right operand method but not a left operand method, the right operand method is not called. Instead, two attempts are made to call the left

[Python-Dev] First PyPy (preview) release

2005-05-20 Thread Armin Rigo
. Please feel free to give feedback and raise questions. contact points: http://codespeak.net/pypy/index.cgi?contact contributor list: http://codespeak.net/pypy/index.cgi?doc/contributor.html have fun, Armin Rigo, Samuele Pedroni, Holger Krekel, Christian Tismer, Carl

Re: [Python-Dev] Localized Type Inference of Atomic Types in Python

2005-05-25 Thread Armin Rigo
Hi Brett, On Tue, May 24, 2005 at 04:11:34PM -0700, Brett C. wrote: My thesis, Localized Type Inference of Atomic Types in Python, was successfully defended today for my MS in Computer Science at the California Polytechnic State University, San Luis Obispo. Congratulations ! Nitpickingly...

Re: [Python-Dev] refcounting vs PyModule_AddObject

2005-06-15 Thread Armin Rigo
Hi Michael, On Wed, Jun 15, 2005 at 01:35:35PM +0100, Michael Hudson wrote: if (ProfilerError == NULL) ProfilerError = PyErr_NewException(hotshot.ProfilerError, NULL, NULL); if (ProfilerError != NULL) {

Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _csv.c, 1.37, 1.38

2005-06-15 Thread Armin Rigo
Hi Skip, On Wed, Jun 15, 2005 at 06:35:10AM -0700, [EMAIL PROTECTED] wrote: Why this worked is a bit mystical. Perhaps it never gets freed because the object just happens never to be DECREF'd (but that seems unlikely). /* Add the Dialect type */ + Py_INCREF(Dialect_Type);

[Python-Dev] PyPy release 0.7.0

2005-08-28 Thread Armin Rigo
questions. contact points: http://codespeak.net/pypy/dist/pypy/doc/contact.html contributor list: http://codespeak.net/pypy/dist/pypy/doc/contributor.html have fun, the pypy team, of which here is a partial snapshot of mainly involved persons: Armin Rigo, Samuele Pedroni

Re: [Python-Dev] bug in urlparse

2005-09-06 Thread Armin Rigo
Hi Duncan, On Tue, Sep 06, 2005 at 12:51:24PM +0100, Duncan Booth wrote: The net effect of this is that on some sites using a Python spider (e.g. webchecker.py) will produce a large number of error messages for links which browsers will actually resolve successfully. As far as I'm

Re: [Python-Dev] IMPORTANT: release24-maint branch is FROZEN from 2005-09-21 00:00 UTC for 2.4.2

2005-09-20 Thread Armin Rigo
Hi, A quick note, the profile.py module is broken -- crashes on some examples and real-world programs. I think I should be able to fix it by tomorrow, but not tonight. (See example checked in in the CVS trunk -- Lib/test/test_profile -- which passes, but for some reason I get completely

Re: [Python-Dev] IMPORTANT: release24-maint branch is FROZEN from 2005-09-21 00:00 UTC for 2.4.2

2005-09-20 Thread Armin Rigo
Hi, On Tue, Sep 20, 2005 at 09:21:14PM +0200, Armin Rigo wrote: A quick note, the profile.py module is broken -- crashes on some examples and real-world programs. I think I should be able to fix it by tomorrow, but not tonight. It was easier than I thought, sorry for the alarm. Armin

Re: [Python-Dev] AST branch update

2005-10-17 Thread Armin Rigo
Hi Jeremy, On Thu, Oct 13, 2005 at 04:52:14PM -0400, Jeremy Hylton wrote: I don't think the current test suite covers all of the possible syntax errors that can be raised. I'd like to add a new test suite that covers all of the remaining cases, perhaps moving some existing tests into this

Re: [Python-Dev] Is some magic required to check out new files from svn?

2005-11-16 Thread Armin Rigo
Hi, On Sun, Nov 13, 2005 at 07:08:15AM -0600, [EMAIL PROTECTED] wrote: The full svn status output is % svn status ! . ! Python The ! definitely mean that these items are missing, or for directories, incomplete in some way. You need to play around until the ! goes

[Python-Dev] s/hotshot/lsprof

2005-11-19 Thread Armin Rigo
Hi! The current Python profilers situation is a mess. 'profile.Profile' is the ages-old pure Python profiler. At the end of a run, it builds a dict that is inspected by 'pstats.Stats'. It has some recent support for profiling C calls, which however make it crash in some cases [1]. And of

Re: [Python-Dev] s/hotshot/lsprof

2005-11-21 Thread Armin Rigo
Hi Brett, hi Floris, On Sat, Nov 19, 2005 at 04:12:28PM -0800, Brett Cannon wrote: Just for everyone's FYI while we are talking about profilers, Floris Bruynooghe (who I am cc'ing on this so he can contribute to the conversation), for Google's Summer of Code, wrote a replacement for

Re: [Python-Dev] s/hotshot/lsprof

2005-11-21 Thread Armin Rigo
Hi Barry, On Mon, Nov 21, 2005 at 11:40:37AM -0500, Barry Warsaw wrote: Hi Armin. Actually it was SF #900092 that I was referring to. Ah, we're talking about different things then. The patch in SF #900092 is not related to hotshot, it's just ceval.c not producing enough events to allow a

Re: [Python-Dev] s/hotshot/lsprof

2005-11-21 Thread Armin Rigo
Hi Floris, On Mon, Nov 21, 2005 at 04:41:04PM +, Floris Bruynooghe wrote: Now Brett's student, Floris, extended hotshot to allow custom timers. This is essential, because it enables testing. The timing parts of hotshot were not tested previously. Don't be too enthousiastic here.

Re: [Python-Dev] s/hotshot/lsprof

2005-11-21 Thread Armin Rigo
Hi Floris, On Mon, Nov 21, 2005 at 04:45:03PM +, Floris Bruynooghe wrote: Afaik I did test recursive calls etc. It seems to show up in any test case I try, e.g. import hprofile def wait(m): if m 0: wait(m-1) def f(n): wait(n) if n 1:

Re: [Python-Dev] s/hotshot/lsprof

2005-11-21 Thread Armin Rigo
Hi Martin, On Mon, Nov 21, 2005 at 10:29:55PM +0100, Martin v. L?wis wrote: I see no incremental way of fixing some of the downsides of hotshot, like its huge log file size and loading time. I haven't looked into the details myself, but it appears that some google-summer-of-code

Re: [Python-Dev] Problems with the Python Memory Manager

2005-11-24 Thread Armin Rigo
Hi, On Thu, Nov 24, 2005 at 01:59:57AM -0800, Robert Kern wrote: You can get the version of scipy_core just before the fix that Travis applied: Now we can start debugging :-) http://projects.scipy.org/scipy/scipy_core/changeset/1490 This changeset alone fixes the small example you

Re: [Python-Dev] Problems with the Python Memory Manager

2005-11-24 Thread Armin Rigo
Hi, Ok, here is the reason for the leak... There is in scipy a type called 'int32_arrtype' which inherits from both another scipy type called 'signedinteger_arrtype', and from 'int'. Obscure! This is not 100% officially allowed: you are inheriting from two C types. You're living dangerously!

Re: [Python-Dev] Problems with mro for dual inheritance in C [Was: Problems with the Python Memory Manager]

2005-11-24 Thread Armin Rigo
Hi Travis, On Thu, Nov 24, 2005 at 10:17:43AM -0700, Travis E. Oliphant wrote: Why doesn't the int32 type inherit its tp_free from the early types first? In your case I suspect that the tp_free is inherited from the tp_base which is probably 'int'. I don't see how to fix typeobject.c,

Re: [Python-Dev] Problems with the Python Memory Manager

2005-11-25 Thread Armin Rigo
Hi Jim, You wrote: (2) Is he allocating new _types_, which I think don't get properly collected. (Off-topic) For reference, as far as I know new types are properly freed. There has been a number of bugs and lots of corner cases to fix, but I know of no remaining one. This assumes that the

Re: [Python-Dev] For Python 3k, drop default/implicit hash, and comparison

2005-11-27 Thread Armin Rigo
Hi Noam, On Sun, Nov 27, 2005 at 09:04:25PM +0200, Noam Raphael wrote: No, I meant real programming examples. My theory is that most user-defined classes have a value, and those that don't are related to I/O, in some sort of a broad definition of the term. I may be wrong, so I ask for

Re: [Python-Dev] Expose Subversion revision number to Python

2005-12-16 Thread Armin Rigo
Hi Barry, On Fri, Dec 16, 2005 at 12:16:49AM -0500, Barry Warsaw wrote: SF patch # 1382163 is a fairly simple patch to expose the Subversion revision number to Python, both in the Py_GetBuildInfo() text, and in a new Py_GetBuildNumber() C API function, and via a new sys.build_number

Re: [Python-Dev] Expose Subversion revision number to Python

2005-12-16 Thread Armin Rigo
Hi Phillip, On Fri, Dec 16, 2005 at 10:51:33AM -0500, Phillip J. Eby wrote: svn info -R|grep '^Last Changed Rev'|sort -nr|head -1|cut -f 4 -d To get the highest-numbered revision. However, both this approach and yours will not deal with Subversion messages in non-English locales.

Re: [Python-Dev] Expose Subversion revision number to Python

2005-12-16 Thread Armin Rigo
Hi Skip, On Fri, Dec 16, 2005 at 05:02:19AM -0600, [EMAIL PROTECTED] wrote: Armin (trunk is the last part of the path returned by svn info.) Did you mean the last part of the URL? Yes, sorry. Armin ___ Python-Dev mailing list

Re: [Python-Dev] Expose Subversion revision number to Python

2005-12-16 Thread Armin Rigo
Hi Phillip, On Fri, Dec 16, 2005 at 10:59:23AM -0500, Phillip J. Eby wrote: The Revision from svn info isn't reliable; it doesn't actually relate to what version of code is in the subtree. It can change when nothing has changed. Indeed, the patch should not use the Revision line but the

Re: [Python-Dev] Expose Subversion revision number to Python

2005-12-16 Thread Armin Rigo
Hi Phillip, On Fri, Dec 16, 2005 at 11:33:00AM -0500, Phillip J. Eby wrote: Not if you're happy with Last Changed Rev: LC_ALL=C svn info | grep -i last changed rev | cut -f 4 -d You left off the all-important -R from svn info, and the sort -nr | head -1 at the end. The Last

Re: [Python-Dev] Expose Subversion revision number to Python

2005-12-18 Thread Armin Rigo
Hi Barry, On Sat, Dec 17, 2005 at 08:28:17PM -0500, Barry Warsaw wrote: Done. r41744. Doesn't appear to work for me: sys.build_number receives the value from the buildno. Looking at the Makefile, the reason is that I'm building CPython in a separate directory (running '/some/path/configure;

Re: [Python-Dev] NotImplemented reaching top-level

2005-12-25 Thread Armin Rigo
Hi Facundo, On Sat, Dec 24, 2005 at 02:31:19PM -0300, Facundo Batista wrote: d += 1.2 d NotImplemented The situation appears to be a mess. Some combinations of specific operators fail to convert NotImplemented to a TypeError, depending on old- or new-style-class-ness, although this is

Re: [Python-Dev] NotImplemented reaching top-level

2005-12-25 Thread Armin Rigo
Hi Reinhold, On Sun, Dec 25, 2005 at 12:37:53PM +0100, Reinhold Birkenfeld wrote: that nobody fully understands the convoluted code paths of abstract.c any more :-( Time for a rewrite? Of course, speaking of a rewrite, PyPy does the right thing in these two areas. Won't happen to

Re: [Python-Dev] NotImplemented reaching top-level

2005-12-26 Thread Armin Rigo
Hi Brett, On Sun, Dec 25, 2005 at 11:55:11AM -0800, Brett Cannon wrote: Maybe. Also realize we will have a chance to clean it up when Python 3 comes around since the classic class stuff will be ripped out. That way we might have a chance to streamline the code. For once, old-style classes

Re: [Python-Dev] NotImplemented reaching top-level

2005-12-26 Thread Armin Rigo
Hi, On Mon, Dec 26, 2005 at 02:40:38AM +1000, Nick Coghlan wrote: That sounds like the right definition to me (I believe this behaviour is what Raymond and Facundo were aiming for with the last round of updates to Decimal). Done in patch #1390657. Although this patch passes all existing

Re: [Python-Dev] deque alternative

2005-12-27 Thread Armin Rigo
Hi Christian, On Mon, Dec 26, 2005 at 01:38:37PM +0100, Christian Tismer wrote: I don't think your code has to decide about this. The power lies in the fact that you don't specify that, but just use the list in a different way. We do this in the PyPy implementation; right now it is true that

Re: [Python-Dev] NotImplemented reaching top-level

2005-12-27 Thread Armin Rigo
Hi Facundo, On Mon, Dec 26, 2005 at 02:31:10PM -0300, Facundo Batista wrote: nb_add and nb_multiply should be tried. I don't think that this would break existing C or Python code, but it should probably only go in 2.5, together with the patch #1390657 that relies on it. It'd be good to

Re: [Python-Dev] NotImplemented reaching top-level

2005-12-28 Thread Armin Rigo
Hi Marc, On Wed, Dec 28, 2005 at 09:56:43PM +0100, M.-A. Lemburg wrote: d += 1.2 d NotImplemented The PEP documenting the coercion logic has complete tables for what should happen: Well, '+=' does not invoke coercion at all, with new-style classes like Decimal. Looking at the code in

Re: [Python-Dev] New PEP: Using ssize_t as the index type

2005-12-29 Thread Armin Rigo
Hi Martin, On Thu, Dec 29, 2005 at 03:04:30PM +0100, Martin v. L?wis wrote: New conversion functions PyInt_FromSsize_t, PyInt_AsSsize_t, PyLong_AsSsize_t are introduced. PyInt_FromSsize_t will transparently return a long int object if the value exceeds the MAX_INT. I guess you mean LONG_MAX

Re: [Python-Dev] buildno (Was: [Python-checkins] commit of r41907- python/trunk/Makefile.pre.in)

2006-01-05 Thread Armin Rigo
Hi Martin, On Thu, Jan 05, 2006 at 12:36:40AM +0100, Martin v. L?wis wrote: OTOH, I also think we should get rid of buildno entirely. Instead, svnversion should be compiled into the object file, or, if it is absent, $Revision$ should be used; the release process should be updated to force a

Re: [Python-Dev] New PEP: Using ssize_t as the index type

2006-01-05 Thread Armin Rigo
Hi Martin, On Fri, Dec 30, 2005 at 11:26:44AM +0100, Martin v. L?wis wrote: Hum. It would be much cleaner to introduce a new format character to replace '#' and deprecate '#'... That would certainly be clearer. What character would you suggest? I see two drawbacks with that approach:

Re: [Python-Dev] Draft proposal: Implicit self in Python 3.0

2006-01-06 Thread Armin Rigo
Hi Alexander, On Fri, Jan 06, 2006 at 12:56:01AM +0300, Alexander Kozlovsky wrote: There are three different peculiarity in Python 2.x in respect of 'self' method argument: Yuk! This has been discussed again and again already. *Please* move this discussion to comp.lang.python. A bientot,

Re: [Python-Dev] Ph.D. dissertation ideas?

2006-01-14 Thread Armin Rigo
Hi Brett, If by any chance PyPy continues to be funded beyond 2006, we would definitely welcome you around :-) (If our funding model doesn't change, it might be difficult for us to give you money oversea, though... just asking, just in case, would you consider moving to a European university?)

[Python-Dev] Summer of PyPy

2006-01-17 Thread Armin Rigo
Hi Brett, hi all, On Sat, Jan 14, 2006 at 05:51:25PM -0800, Brett Cannon wrote: That would be cool! I definitely would not mind working on PyPy. Unfortunately I would not consider changing universities; I really like it here. We are looking at the possibility to do a Summer of PyPy in the

[Python-Dev] cProfile module

2006-02-07 Thread Armin Rigo
Hi all, As promized two months ago, I eventually finished the integration of the 'lsprof' profiler. It's now in an internal '_lsprof' module that is exposed via a 'cProfile' module with the same interface as 'profile', producing compatible dump stats that can be inspected with 'pstats'. See

[Python-Dev] _length_cue()

2006-02-08 Thread Armin Rigo
Hi all, Last september, the __len__ method of iterators was removed -- see discussion at: http://mail.python.org/pipermail/python-dev/2005-September/056879.html It was replaced by an optional undocumented method called _length_cue(), which would be used to guess the number of remaining items in

Re: [Python-Dev] _length_cue()

2006-02-08 Thread Armin Rigo
Hi Raymond, On Wed, Feb 08, 2006 at 03:02:21PM -0500, Raymond Hettinger wrote: IMHO, the safety reasons are imaginary -- the scenario would involve subclassing one of these builtin objects and attaching an identically named private method. No, the senario applies to any user-defined

Re: [Python-Dev] _length_cue()

2006-02-10 Thread Armin Rigo
Hi Greg, On Thu, Feb 09, 2006 at 04:27:54PM +1300, Greg Ewing wrote: The iterator protocol is currently very simple and well-focused on a single task -- producing things one at a time, in sequence. Let's not clutter it up with too much more cruft. Please refer to my original message: I

Re: [Python-Dev] _length_cue()

2006-02-10 Thread Armin Rigo
Hi Nick, On Fri, Feb 10, 2006 at 11:21:52PM +1000, Nick Coghlan wrote: Do they really need anything more sophisticated than: def __repr__(self): return %s(%r) % (type(self).__name__, self._subiter) (modulo changes in the format of arguments, naturally. This simple one would work

Re: [Python-Dev] _length_cue()

2006-02-10 Thread Armin Rigo
Hi Raymond, On Wed, Feb 08, 2006 at 09:21:02PM -0500, Raymond Hettinger wrote: (... __getitem_cue__ ...) Before putting this in production, it would probably be worthwhile to search for code where it would have been helpful. In the case of __length_cue__, there was an immediate payoff.

Re: [Python-Dev] Baffled by PyArg_ParseTupleAndKeywords modification

2006-02-11 Thread Armin Rigo
Hi Tim, On Fri, Feb 10, 2006 at 12:19:01PM -0500, Tim Peters wrote: Oh, who cares? I predict Jack's problem would go away if we changed the declaration of PyArg_ParseTupleAndKeywords to what you intended wink to begin with: PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject

Re: [Python-Dev] Please comment on PEP 357 -- adding nb_index slot to PyNumberMethods

2006-02-17 Thread Armin Rigo
Hi Travis, On Tue, Feb 14, 2006 at 08:41:19PM -0700, Travis E. Oliphant wrote: 2) The __index__ special method will have the signature def __index__(self): return obj Where obj must be either an int or a long or another object that has the

Re: [Python-Dev] 2.5 release schedule

2006-02-17 Thread Armin Rigo
Hi, On Tue, Feb 14, 2006 at 09:24:57PM -0800, Neal Norwitz wrote: http://www.python.org/peps/pep-0356.html There is at least one SF bug, namely #1333982 Bugs of the new AST compiler, that in my humble opinion absolutely needs to be fixed before the release, even though I won't hide that I have

Re: [Python-Dev] str.count is slow

2006-03-12 Thread Armin Rigo
Hi Ben, On Mon, Feb 27, 2006 at 06:50:28PM -0500, Ben Cartwright wrote: It seems to me that str.count is awfully slow. Is there some reason for this? stringobject.c could do with a good clean-up. It contains very similar algorithms multiple times, in slightly different styles and with

Re: [Python-Dev] Making staticmethod objects callable?

2006-03-12 Thread Armin Rigo
Hi Nicolas, On Thu, Mar 02, 2006 at 01:55:03AM -0500, Nicolas Fleury wrote: (...) A use case is not hard to imagine, especially a private static method called only to build a class attribute. Uh. I do this all the time, and the answer is simply: don't make that a staticmethod.

Re: [Python-Dev] refleaks in 2.4

2006-03-27 Thread Armin Rigo
Hi Neal, On Sun, Mar 26, 2006 at 11:39:50PM -0800, Neal Norwitz wrote: test_pkg leaked [10, 10, 10] references This one at least appears to be caused by dummy (deleted) entries in the dictionary of interned strings. So it is not really a leak. It is a pain that it is so hard to figure this

Re: [Python-Dev] INPLACE_ADD and INPLACE_MULTIPLY oddities in ceval.c

2006-03-28 Thread Armin Rigo
Hi, On Mon, Mar 27, 2006 at 08:00:09PM -0800, Guido van Rossum wrote: So for consistency we want a += b to also execute a.__iadd__. The opcode calls PyNumber_InplaceAdd; I think that PyNumber_InplaceAdd (and PySequence_InplaceConcat, if it exists) should test for both the numeric and the

Re: [Python-Dev] INPLACE_ADD and INPLACE_MULTIPLY oddities in ceval.c

2006-03-29 Thread Armin Rigo
Hi Greg, On Wed, Mar 29, 2006 at 12:38:55PM +1200, Greg Ewing wrote: I'm really thinking more about the non-inplace operators. If nb_add and sq_concat are collapsed into a single slot, it seems to me that if you do a = [1, 2, 3] b = array([4, 5, 6]) c = a + b then a will be

Re: [Python-Dev] INPLACE_ADD and INPLACE_MULTIPLY oddities in ceval.c

2006-03-29 Thread Armin Rigo
Hi all, On Tue, Mar 28, 2006 at 09:50:49AM -0800, Guido van Rossum wrote: C extensions are my main worry -- OTOH if += for a list can already passes arbitrary types as the argument, then any extension types should be ready to expect this, right? Yes, I don't think C extensions are going to

Re: [Python-Dev] INPLACE_ADD and INPLACE_MULTIPLY oddities in ceval.c

2006-03-29 Thread Armin Rigo
Hi Tim, On Wed, Mar 29, 2006 at 08:45:10AM -0700, Tim Hochberg wrote: Ouch. Assuming the same path is followed with tuples, I think that this means the following behaviour will continue: t = (1,2,3) a = array([4,5,6]) t += a t array([5, 7, 9]) I fell into the same trap at

Re: [Python-Dev] INPLACE_ADD and INPLACE_MULTIPLY oddities in ceval.c

2006-03-29 Thread Armin Rigo
Hi Tim, Oups, sorry. I only just realized my mistake and the meaning of your message. On Thu, Mar 30, 2006 at 09:27:02AM +0200, Armin Rigo wrote: t = (1,2,3) t += [4,5,6] TypeError: can only concatenate tuple (not list) to tuple t += array([4,5,6]) TypeError

Re: [Python-Dev] refleaks in 2.4

2006-04-01 Thread Armin Rigo
Hi Michael, On Sat, Apr 01, 2006 at 02:54:25PM +0100, Michael Hudson wrote: It's actually because somewhere in the bowels of compilation, the file name being compiled gets interned and test_pkg writes out some temporary files and imports them. If this doesn't happen on the trunk, did this

Re: [Python-Dev] refleaks in 2.4

2006-04-12 Thread Armin Rigo
Hi all, On Sun, Mar 26, 2006 at 11:39:50PM -0800, Neal Norwitz wrote: There are 5 tests that leak references that are present in 2.4.3c1, but not on HEAD. It would be great if someone can diagnose these and suggest a fix. test_doctest leaked [1, 1, 1] references test_pkg leaked [10, 10,

Re: [Python-Dev] Checkin 45232: Patch #1429775

2006-04-15 Thread Armin Rigo
Hi Simon, On Thu, Apr 13, 2006 at 06:43:09PM +0200, Simon Percivall wrote: Building SVN trunk with --enable-shared has been broken on Mac OS X Intel since rev. 45232 a couple of days ago. I can't say if this is the case anywhere else as well. What happens is simply that ld can't find the

Re: [Python-Dev] Checkin 45232: Patch #1429775

2006-04-15 Thread Armin Rigo
Hi Martin, On Sat, Apr 15, 2006 at 11:30:07AM +0200, Martin v. L?wis wrote: Armin Rigo wrote: For what it's worth, it still works on Linux (Gentoo/i386), insofar as it always worked -- which is that we need either to make install or to tweak /etc/ld.so.conf to let the executable find

Re: [Python-Dev] possible fix for recursive __call__ segfault

2006-04-18 Thread Armin Rigo
Hi Brett, On Mon, Apr 17, 2006 at 05:34:16PM -0700, Brett Cannon wrote: + if (meth == self) { + PyErr_SetString(PyExc_RuntimeError, + recursive __call__ definition); + return NULL; + } This is not the proper way, as it

[Python-Dev] EuroPython 2006: Call for papers

2006-04-25 Thread Armin Rigo
Hi all, A shameless plug and reminder for EuroPython 2006 (July 3-5): * you can submit talk proposals until May 31st. * there is a refereed papers track; deadline for abstracts: May 5th. See the full call for papers below. A bientot, Armin Rigo Carl Friedrich Bolz

Re: [Python-Dev] rich comparisions and old-style classes

2006-04-30 Thread Armin Rigo
Hi Fredrik, On Sun, Apr 30, 2006 at 08:13:40AM +0200, Fredrik Lundh wrote: trying to come up with a more concise description of the rich comparision machinery for pyref.infogami.com, That's quite optimistic. It's a known dark area. I stumbled upon an oddity that I cannot really explain:

Re: [Python-Dev] New methods for weakref.Weak*Dictionary types

2006-05-10 Thread Armin Rigo
Hi Tim, On Mon, May 01, 2006 at 04:57:06PM -0400, Tim Peters wrote: # Return a list of weakrefs to all the objects in the collection. # Because a weak dict is used internally, iteration is dicey (the # underlying dict may change size during iteration, due to gc or # activity

[Python-Dev] dictionary order

2006-05-28 Thread Armin Rigo
Hi all, I'm playing with dicts that mangle the hash they receive before using it for hashing. The goal was to detect obscure dict order dependencies in my own programs, but I couldn't resist and ran the Python test suite with various mangling schemes. As expected -- what is not tested is broken

[Python-Dev] Let's stop eating exceptions in dict lookup

2006-05-29 Thread Armin Rigo
Hi all, I've finally come around to writing a patch that stops dict lookup from eating all exceptions that occur during lookup, like rare bugs in user __eq__() methods. After another 2-hours long debugging session that turned out to be caused by that, I had a lot of motivation.

Re: [Python-Dev] Let's stop eating exceptions in dict lookup

2006-05-29 Thread Armin Rigo
Hi Guido, On Mon, May 29, 2006 at 12:34:30PM -0700, Guido van Rossum wrote: +1, as long as (as you seem to imply) PyDict_GetItem() still swallows all exceptions. Yes. Fixing PyDict_GetItem() is a py3k issue, I think. Until then, there are way too many uses. I wouldn't be surprised if after

Re: [Python-Dev] Let's stop eating exceptions in dict lookup

2006-05-29 Thread Armin Rigo
Hi Raymond, On Mon, May 29, 2006 at 12:20:44PM -0700, Raymond Hettinger wrote: I've finally come around to writing a patch that stops dict lookup from eating all exceptions that occur during lookup, like rare bugs in user __eq__() methods. Is there a performance impact? I believe that

Re: [Python-Dev] Let's stop eating exceptions in dict lookup

2006-05-29 Thread Armin Rigo
Hi Raymond, On Mon, May 29, 2006 at 02:02:25PM -0700, Raymond Hettinger wrote: Please run some better benchmarks and do more extensive assessments on the performance impact. At the moment, I'm trying to, but 2.5 HEAD keeps failing mysteriously on the tests I try to time, and even going into

Re: [Python-Dev] Let's stop eating exceptions in dict lookup

2006-05-29 Thread Armin Rigo
Re-hi, On Mon, May 29, 2006 at 11:34:28PM +0200, Armin Rigo wrote: At the moment, I'm trying to, but 2.5 HEAD keeps failing mysteriously on the tests I try to time, and even going into an infinite loop consuming all my memory Ah, it's a corner case of str.find() whose behavior just changed

Re: [Python-Dev] Let's stop eating exceptions in dict lookup

2006-05-29 Thread Armin Rigo
Hi Fredrik, On Tue, May 30, 2006 at 12:01:46AM +0200, Fredrik Lundh wrote: not unless you can produce some code. unfounded accusations don't belong on this list (it's not like the sprinters didn't test the code on a whole bunch of platforms), and neither does lousy benchmarks (why are you

Re: [Python-Dev] Let's stop eating exceptions in dict lookup

2006-05-29 Thread Armin Rigo
Hi Fredrik, On Tue, May 30, 2006 at 12:23:04AM +0200, Fredrik Lundh wrote: well, the empty string is a valid substring of all possible strings (there are no null strings in Python). you get the same behaviour from slicing, the in operator, replace (this was discussed on the list last

Re: [Python-Dev] Let's stop eating exceptions in dict lookup

2006-05-30 Thread Armin Rigo
Hi Fredrik, On Tue, May 30, 2006 at 07:48:50AM +0200, Fredrik Lundh wrote: since abc.find(, 0) == 0, I would have thought that a program that searched for an empty string in a loop wouldn't get anywhere at all. Indeed. And when this bug was found in the program in question, a natural fix was

Re: [Python-Dev] 'fast locals' in Python 2.5

2006-06-07 Thread Armin Rigo
Hi, On Wed, Jun 07, 2006 at 02:07:48AM +0200, Thomas Wouters wrote: I just submitted http://python.org/sf/1501934 and assigned it to Neal so it doesn't get forgotten before 2.5 goes out ;) It seems Python 2.5 compiles the following code incorrectly: No, no, it's an underground move by Jeremy

Re: [Python-Dev] Please stop changing wsgiref on the trunk

2006-06-13 Thread Armin Rigo
Hi Phillip, On Mon, Jun 12, 2006 at 12:29:48PM -0400, Phillip J. Eby wrote: This idea would address the needs of external maintainers (having a single release history) while still allowing Python developers to modify the code (if the external package is in Python's SVN repository). It's

Re: [Python-Dev] Improve error msgs?

2006-06-14 Thread Armin Rigo
Hi Georg, On Wed, Jun 14, 2006 at 08:51:03AM +0200, Georg Brandl wrote: type_error(object does not support item assignment); It helps debugging if the object's type was prepended. Should I go through the code and try to enhance them where possible? I think it's an excellent idea. Armin

Re: [Python-Dev] An obscene computed goto bytecode hack for switch :)

2006-06-17 Thread Armin Rigo
Hi Phillip, On Fri, Jun 16, 2006 at 10:01:05PM -0400, Phillip J. Eby wrote: One thing I'm curious about, if there are any PyPy folks listening: will tricks like this drive PyPy or Psyco insane? :) Yes, both :-) The reason is that the details of the stack behavior of END_FINALLY are messy in

Re: [Python-Dev] Is Lib/test/crashers/recursive_call.py really a crasher?

2006-06-28 Thread Armin Rigo
Hi Brett, On Tue, Jun 27, 2006 at 10:32:08AM -0700, Brett Cannon wrote: OK, with you and Thomas both wanting to keep it I will let it be. I just won't worry about fixing it myself during my interpreter hardening crusade. I agree with this too. If I remember correctly, you even mentioned in

Re: [Python-Dev] PEP 3103: A Switch/Case Statement

2006-06-30 Thread Armin Rigo
Hi, On Mon, Jun 26, 2006 at 12:23:00PM -0700, Guido van Rossum wrote: Feedback (also about misrepresentation of alternatives I don't favor) is most welcome, either to me directly or as a followup to this post. So my 2 cents, particularly about when things are computed and ways to control that

Re: [Python-Dev] For sandboxing: alternative to crippling file()

2006-06-30 Thread Armin Rigo
Hi Brett, On Thu, Jun 29, 2006 at 11:48:36AM -0700, Brett Cannon wrote: 1) Is removing 'file' from the builtins dict in PyInterpreterState (and maybe some other things) going to be safe enough to sufficiently hide 'file' confidently (short of someone being stupid in their C extension module

Re: [Python-Dev] Cleanup of test harness for Python

2006-07-01 Thread Armin Rigo
Hi all, On Fri, Jun 30, 2006 at 10:05:14AM -0400, Frank Wierzbicki wrote: some checks for CPython internal tests that should be excluded from Jython I know Frank already knows about this, but I take the occasion to remind us that

Re: [Python-Dev] sys.settrace() in Python 2.3 vs. 2.4

2006-07-01 Thread Armin Rigo
Hi Josiah, On Fri, Jun 30, 2006 at 01:27:24PM -0700, Josiah Carlson wrote: I'll just have to gracefully degrade functionality for older Pythons. More precisely, the bug shows up because in while 1: pass the current line remains on the 'pass' forever. It works for a loop like that:

Re: [Python-Dev] what can we do to hide the 'file' type?

2006-07-06 Thread Armin Rigo
Hi Brett, On Wed, Jul 05, 2006 at 05:01:48PM -0700, Brett Cannon wrote: And if Armin and/or Samuele sign off that what we find is most likely (with most likely equalling 99% chance) all there is, then bonus points and I will *really* be convinced. =) I don't think I can sign off that.

  1   2   3   4   >