[Python-Dev] Re: [Python-checkins] python/dist/src/Lib whrandom.py, 1.21, NONE

2004-12-04 Thread Tim Peters
[EMAIL PROTECTED] Removed Files: whrandom.py Log Message: Remove the deprecated whrandom module. Woo hoo! It's about friggin' time wink. ___ Python-Dev mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] [Python 2.4] PyInt_FromLong returning NULL

2004-12-07 Thread Tim Peters
[Andreas Jung] While using Zope 2.7 Do you mean 2.7, or do you mean 2.7.3, or ...? with Python 2.4 we discovered some strange behaviour of the security machinery. I could track this down to some Zope code in cAccessControl.c where an Unauthorized exception is raised because of a call to

Re: [Python-Dev] RE: [Python-checkins] python/dist/src/Modules posixmodule.c, 2.300.8.10, 2.300.8.11

2004-12-18 Thread Tim Peters
[Raymond, says test_glob and test_urllib fail on WinME now] [Andrew MacIntyre] I don't see any possible way for those checkins to affect any platform other than OS/2. 2 of the files are platform specific files (PC/os2emx/getpath.c, PC/os2vacpp/getpath.c), and the checkin to

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

2004-12-20 Thread Tim Peters
[Jeremy Hylton on a quick 2.4.1] Nothing wrong with an incremental release, but none of these sound like critical bugs to me. [Aahz] You don't think a blowup in marshal is critical? Mind expanding on that? [Jeremy] An undocumented extension to marshal causes a segfault. It's certainly a

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

2004-12-21 Thread Tim Peters
[Armin Rigo] Some code in the 'py' lib used to use marshal to send simple objects between the main process and a subprocess. We ran into trouble when we extended the idea to a subprocess that would actually run via ssh on a remote machine, and the remote machine's Python version didn't match

Re: [Python-Dev] Darwin's realloc(...) implementation never shrinks allocations

2005-01-02 Thread Tim Peters
[Bob Ippolito] ... Your expectation is not correct for Darwin's memory allocation scheme. It seems that Darwin creates allocations of immutable size. The only way ANY part of an allocation will ever be used by ANYTHING else is if free() is called with that allocation. Ya, I understood that.

Re: [Python-Dev] Darwin's realloc(...) implementation never shrinks allocations

2005-01-03 Thread Tim Peters
[Tim Peters] Ya, I understood that. My conclusion was that Darwin's realloc() implementation isn't production-quality. So it goes. [Bob Ippolito] Whatever that means. Well, it means what it said. The C standard says nothing about performance metrics of any kind, and a production-quality

Re: [Python-Dev] Darwin's realloc(...) implementation never shrinks allocations

2005-01-03 Thread Tim Peters
[Bob Ippolito] ... What about for list objects that are big at some point, then progressively shrink, but happen to stick around for a while? An event queue that got clogged for some reason and then became stable? It's less plausible that we''re going to see a lot of these simultaneously

Re: [Python-Dev] Let's get rid of unbound methods

2005-01-04 Thread Tim Peters
[Guido] In my blog I wrote: Let's get rid of unbound methods. When class C defines a method f, C.f should just return the function object, not an unbound method that behaves almost, but not quite, the same as that function object. The extra type checking on the first argument that unbound

Re: [Python-Dev] Will ASTbranch compile on windows yet?

2005-01-04 Thread Tim Peters
[EMAIL PROTECTED] I submitted patch [ 742621 ] ast-branch: msvc project sync in the VC6.0 days. There were some required changes to headers as well as the project files. It had discouraged me in the past when Jeremy made calls for help on the astbranch and I wasn't even sure if the source

Re: [Python-Dev] Let's get rid of unbound methods

2005-01-04 Thread Tim Peters
[Tim Peters] ... Unbound methods are used most often (IME) to call a base-class method from a subclass, like my_base.the_method(self, ...). It's especially easy to forget to write `self, ` there, and the exception msg then is quite focused because of that extra bit of type checking

Re: [Python-Dev] Re: super() harmful?

2005-01-06 Thread Tim Peters
[Guido] Then why is the title Python's Super Considered Harmful ??? Here's my final offer. Change the title to something like Multiple Inheritance Pitfalls in Python and nobody will get hurt. [Bill Janssen] Or better yet, considering the recent thread on Python marketing, Multiple

Re: [Python-Dev] Re: [Csv] csv module TODO list

2005-01-07 Thread Tim Peters
[Andrew McNamara] Also, review comments from Jeremy Hylton, 10 Apr 2003: I've been reviewing extension modules looking for C types that should participate in garbage collection. I think the csv ReaderObj and WriterObj should participate. The ReaderObj it contains a reference to

Re: [Python-Dev] a bunch of Patch reviews

2005-01-18 Thread Tim Peters
[Martin asks whether Irmen wants to be a tracker admin on SF] [Irmen de Jong] That sounds very convenient, thanks. Does the status of 'python project member' come with certain expectations that must be complied with ? ;-) If you're using Python, you're already required to comply with all of

Re: [Python-Dev] a bunch of Patch reviews

2005-01-20 Thread Tim Peters
[Martin v. Löwis] ... - Add an entry to Misc/NEWS, if there is a new feature, or if it is a bug fix for a maintenance branch (I personally don't list bug fixed in the HEAD revision, but others apparently do) You should. In part this is to comply with license requirements: we're a

Re: [Python-Dev] a bunch of Patch reviews

2005-01-20 Thread Tim Peters
[Tim Peters] It's also extremely useful in practice to have a list of repaired bugs in NEWS! [Martin v. Löwis] I'm not convinced about that - it makes the NEWS file almost unreadable, as the noise is now so high if every tiny change is listed; it is very hard to see what the important

Re: [Python-Dev] state of 2.4 final release

2005-01-25 Thread Tim Peters
[Anthony Baxter] I didn't see any replies to the last post, so I'll ask again with a better subject line - as I said last time, as far as I'm aware, I'm not aware of anyone having done a fix for the issue Tim identified ( http://www.python.org/sf/1069160 ) So, my question is: Is this

Re: [Python-Dev] Python Interpreter Thread Safety?

2005-01-28 Thread Tim Peters
... [Evan Jones] What I was trying to ask with my last email was what are the trouble areas? There are probably many that I am unaware of, due to my unfamiliarity the Python internals. Google on Python free threading. That's not meant to be curt, it's just meant to recognize that the task is

Re: [Python-Dev] Is msvcr71.dll re-redistributable?

2005-02-02 Thread Tim Peters
[Thomas Heller] ... For the spambayes binary, maybe there should be another person adding the msvcr71.dll to the distribution that Tony builds? Someone who has a MSVC license, and also is developer on the spambayes project? To the best of my knowledge, Tony is distributing my duly licensed

Re: [Python-Dev] 2.3.5 and 2.4.1 release plans

2005-02-06 Thread Tim Peters
[Anthony Baxter] Ok, so here's the state of play: 2.3.5 is currently aimed for next Tuesday, but there's an outstanding issue - the new copy code appears to have broken something, see www.python.org/sf/1114776 for the gory details. ... [Alex Martelli] The problem boils down to: deepcopying

Re: [Python-Dev] update copyright date in PC/python_nt.rc?

2005-02-09 Thread Tim Peters
[Trent Mick] The copyright date was updated to 2005 in Python/getcopyright.c. Should the same be done in PC/python_nt.rc? Yes. Or perhaps, is there any reason python_nt.rc should NOT be updated? Only reason I can think of is your inexcusable laziness for not having done it yourself wink.

[Python-Dev] Re: [Python-checkins] python/dist/src/Lib xmlrpclib.py, 1.38, 1.39

2005-02-10 Thread Tim Peters
[EMAIL PROTECTED] Modified Files: xmlrpclib.py Log Message: accept datetime.datetime instances when marshalling; dateTime.iso8601 elements still unmarshal into xmlrpclib.DateTime objects Index: xmlrpclib.py ... +if datetime and isinstance(value, datetime.datetime): +

[Python-Dev] Re: [Python-checkins] python/dist/src/Lib xmlrpclib.py, 1.38, 1.39

2005-02-10 Thread Tim Peters
[Tim] Fred, is there a reason to avoid datetime.datetime's .isoformat() method here? Like so: Yes. The XML-RPC spec is quite vague. It claims that the dates are in ISO 8601 format, but doesn't say anything more about it. The example shows a string without hyphens (but with colons), so I

[Python-Dev] Re: [Python-checkins] python/dist/src/Lib xmlrpclib.py, 1.38, 1.39

2005-02-10 Thread Tim Peters
[Tim] Well, then since that isn't ISO 8601 format, it would be nice to have a comment explaining why it's claiming to be anyway 0.5 wink. [Fred] Hmm, that's right (ISO 8601:2000, section 5.4.2). Sigh. Ain't your fault. I didn't remember that I had seen the XML-RPC spec before, in

Re: [Python-Dev] ViewCVS on SourceForge is broken

2005-02-11 Thread Tim Peters
[Trent Mick] Has anyone else noticed that viewcvs is broken on SF? It failed the same way from Virginia just now. I suppose that's your reward for kindly updating the Python copyright wink. The good news is that you can use this lull in your Python work to contribute to ZODB development!

Re: [Python-Dev] ViewCVS on SourceForge is broken

2005-02-11 Thread Tim Peters
are currently working on resolving this issue. So that means it wouldn't even do us any good to rename the project to Thomas, Trent, Mick, Tim, Peters, or ZPython either! All right. Heller 2.5, here we come. ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] license issues with profiler.py and md5.h/md5c.c

2005-02-11 Thread Tim Peters
[Jeremy Hylton] Unfortunately a license that says it is in the public domain is unacceptable (and should be for Debian, too). That is to say, it's not possible for someone to claim that something they produce is in the public domain. See http://www.linuxjournal.com/article/6225 [Michael

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

2005-02-14 Thread Tim Peters
[Troels Walsted Hansen] The Python binding in libxml2 uses the following code for __repr__(): class xmlNode(xmlCore): def __init__(self, _obj=None): self._o = None xmlCore.__init__(self, _obj=_obj) def __repr__(self): return xmlNode (%s) object at 0x%x %

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

2005-02-14 Thread Tim Peters
[James Y Knight] I think it'd be nice to change it, too. Twisted also uses a similar function. However, last time this topic came up, this Tim Peters guy argued against it. ;) Quoting http://mail.python.org/pipermail/python-dev/2004-November/050049.html: Python doesn't promise to return

[Python-Dev] Re: [Zope] Windows Low Fragementation Heap yields speedup of ~15%

2005-02-14 Thread Tim Peters
[Gfeller Martin] I'm running a large Zope application on a 1x1GHz CPU 1GB mem Window XP Prof machine using Zope 2.7.3 and Py 2.3.4 The application typically builds large lists by appending and extending them. That's historically been an especially bad case for Windows systems, although the

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

2005-02-15 Thread Tim Peters
[Fredrik Lundh] can anyone explain the struct.pack and ZODB use cases? the first one doesn't make sense to me, Not deep and surely not common, just possible. If you're on a 32-bit box and doing struct.pack(...i..., ... id(obj) ...), it in fact cannot fail now (no, that isn't guaranteed by the

Re: [Python-Dev] pymalloc on 2.1.3

2005-02-15 Thread Tim Peters
[Fredrik Lundh] does anyone remember if there were any big changes in pymalloc between the 2.1 series (where it was introduced) and 2.3 (where it was enabled by default). Yes, huge -- few original lines survived exactly, although many survived in intent. or in other words, is the 2.1.3

Re: [Python-Dev] Memory Allocator Part 2: Did I get it right?

2005-02-15 Thread Tim Peters
[Evan Jones] After I finally understood what thread-safety guarantees the Python memory allocator needs to provide, I went and did some hard thinking about the code this afternoon. I believe that my modifications provide the same guarantees that the original version did. I do need to declare

Re: [Python-Dev] Memory Allocator Part 2: Did I get it right?

2005-02-15 Thread Tim Peters
[Tim Peters] As I said before, I don't think we need to support this any more. More, I think we should not -- the support code is excruciatingly subtle, it wasted plenty of your time trying to keep it working, and if we keep it in it's going to continue to waste time over the coming years

[Python-Dev] 2.4 func.__name__ breakage

2005-02-16 Thread Tim Peters
Rev 2.66 of funcobject.c made func.__name__ writable for the first time. That's great, but the patch also introduced what I'm pretty sure was an unintended incompatibility: after 2.66, func.__name__ was no longer *readable* in restricted execution mode. I can't think of a good reason to

Re: [Python-Dev] 2.4 func.__name__ breakage

2005-02-17 Thread Tim Peters
[Michael Hudson] ... Well, I fixed it on reading the bug report and before getting to python-dev mail :) Sorry if this duplicated your work, but hey, it was only a two line change... Na, the real work was tracking it down in the bowels of Zope's C-coded security machinery -- we'll let you do

Re: [Python-Dev] Re: [ python-Bugs-1124637 ] test_subprocess is far tooslow (fwd)

2005-02-17 Thread Tim Peters
[Fredrik Lundh] does anyone ever use the -u options when running tests? Yes -- I routinely do -uall, under both release and debug builds, but only on Windows. WinXP in particular seems to do a good job when hyper-threading is available -- running the tests doesn't slow down anything else I'm

Re: [Python-Dev] 2.4 func.__name__ breakage

2005-02-17 Thread Tim Peters
[sorry for the near-duplicate msgs -- looks like gmail lied when it claimed the first msg was still in draft status] Did you add a test to ensure this remains fixed? [mwh] Yup. Bless you. Did you attach a contributor agreement and mark the test as being contributed under said contributor

Re: [Python-Dev] [ python-Bugs-1124637 ] test_subprocess is far tooslow (fwd)

2005-02-17 Thread Tim Peters
[Raymond Hettinger] For test_subprocess, consider adopting the technique used by test_decimal. When -u decimal is not specified, a small random selection of the resource intensive tests are run. That way, all of the tests eventually get run even if no one is routinely using -u all. [Michael

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

2005-02-17 Thread Tim Peters
[Tim Peters] # 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). [Armin Rigo] Isn't this natural width nowadays available as: 256 ** struct.calcsize('P

Re: [Python-Dev] Windows Low Fragementation Heap yields speedup of ~15%

2005-02-17 Thread Tim Peters
, so I can only speculate - do the lists at some point grow beyond the upper limit of obmalloc, but are handled by the LFH (which has a higher upper limit, if I understood Tim Peters correctly)? A Python list object comprises two separately allocated pieces of memory. First is a list header

Re: [Python-Dev] Windows Low Fragementation Heap yields speedup of ~15%

2005-02-18 Thread Tim Peters
[Tim Peters] ... Then you allocate a small object, marked 's': bbbsfff [Evan Jones] Isn't the whole point of obmalloc No, because it doesn't matter what follows that introduction: obmalloc has several points, including exploiting the GIL, heuristics

Re: [Python-Dev] Re: Re: Re: Prospective Peephole Transformation

2005-02-18 Thread Tim Peters
[Phillip J. Eby] Still, it's rather interesting that tuple.__contains__ appears slower than a series of LOAD_CONST and == operations, considering that the tuple should be doing basically the same thing, only without bytecode fetch-and- decode overhead. Maybe it's tuple.__contains__ that needs

Re: [Python-Dev] Prospective Peephole Transformation

2005-02-18 Thread Tim Peters
[Raymond Hettinger] ... The problem with the transformation was that it didn't handle the case where x was non-hashable and it would raise a TypeError instead of returning False as it should. I'm very glad you introduced the optimization of building small constant tuples at compile-time.

Re: [Python-Dev] Windows Low Fragementation Heap yields speedup of ~15%

2005-02-18 Thread Tim Peters
[Tim Peters] grow the list to its final size once, at the start (overestimating if you don't know for sure). Then instead of appending, keep an index to the next free slot, same as you'd do in C. Then the list guts never move, so if that doesn't yield the same kind of speedup without using

[Python-Dev] Re: [Python-checkins] python/dist/src/Python compile.c, 2.344, 2.345

2005-02-22 Thread Tim Peters
[EMAIL PROTECTED] Modified Files: compile.c Log Message: Teach the peepholer to fold unary operations on constants. Afterwards, -0.5 loads in a single step and no longer requires a runtime UNARY_NEGATIVE operation. Aargh. The compiler already folded in a leading minus for ints, and

[Python-Dev] Useful thread project for 2.5?

2005-03-04 Thread Tim Peters
Florent Guillaume recently wrote a valuable addin for Zope: http://www.zope.org/Members/nuxeo/Products/DeadlockDebugger When a Zope has threads that are hung, this can give a report of Python's current state (stack trace) across all threads -- even the ones that are hung (the deadlocked

Re: [Python-Dev] Useful thread project for 2.5?

2005-03-06 Thread Tim Peters
[Phillip J. Eby] What would you suggest calling it? sys._current_frames(), returning a dictionary? I don't fight about names -- anything that doesn't make Guido puke works wink. I channel that sys._current_frames() would be fine. A dict mapping thread id to current thread frame would be

Re: [Python-Dev] Re: Useful thread project for 2.5?

2005-03-06 Thread Tim Peters
[Fazal Majid] Since I started this, I might as well finish it. I do have some Python developer experience (hey, I even voted for comp.lang.python back when...) but not in the core interpreter itself. Cool! WRT your current module, it would need changes to follow Python's C coding style, to

Re: [Python-Dev] Re: Useful thread project for 2.5?

2005-03-07 Thread Tim Peters
[Greg Ward] What would be *really* spiffy is to provide a way for externally-triggered thread dumps. This is one of my top two Java features [1]. The way this works in Java is a bit awkward -- kill -QUIT the Java process and it writes a traceback for every running thread to stdout -- but it

[Python-Dev] Can't build Zope on Windows w/ 2.4.1c1

2005-03-10 Thread Tim Peters
I don't know how far I'll get with this. Using the current Zope-2_7-branch of the Zope module at cvs.zope.org:/cvs-repository, building Zope via python setup.py build_ext -i worked fine when I got up today, using the released Python 2.4. One of its tests fails, because of a Python bug that

Re: [Python-Dev] Can't build Zope on Windows w/ 2.4.1c1

2005-03-10 Thread Tim Peters
[Anthony Baxter] It works on Linux, with Zope 2.7.4. Thanks! Just as a note to others (I've mentioned this to Tim already) if you set an environment variable DISTUTILS_DEBUG before running a setup.py, you get very verbose information about what's going on, and, more importantly, full

Re: [Python-Dev] Can't build Zope on Windows w/ 2.4.1c1

2005-03-10 Thread Tim Peters
This is going to need someone who understands distutils internals. The strings we end up passing to putenv() grow absurdly large, and sooner or later Windows gets very unhappy with them. os.py has a elif name in ('os2', 'nt'): # Where Env Var Names Must Be UPPERCASE class controlling

Re: [Python-Dev] Can't build Zope on Windows w/ 2.4.1c1

2005-03-10 Thread Tim Peters
[ A.M. Kuchling] In distutils.msvccompiler: def __init__ (self, verbose=0, dry_run=0, force=0): ... self.initialized = False def compile(self, sources, output_dir=None, macros=None, include_dirs=None, debug=0, extra_preargs=None,

Re: [Python-Dev] RELEASED Python 2.4.1, release candidate 1

2005-03-10 Thread Tim Peters
[Martin v. Löwis] I'd like to encourage feedback on whether the Windows installer works for people. It replaces the VBScript part in the MSI package with native code, which ought to drop the dependency on VBScript, but might introduce new incompatibilities. Worked fine here. Did an

[Python-Dev] Re: distutils fix for building Zope against Python 2.4.1c1

2005-03-11 Thread Tim Peters
[Trent Mick] http://mail.python.org/pipermail/python-checkins/2005-March/045185.html Note that I also could not build PyWin32 against 2.4.1c1 and I suspect this was the same problem. (Still checking to see if this change fixes the PyWin32 build for me.) Be sure to speak up if it doesn't!

Re: [Python-Dev] distutils fix for building Zope against Python 2.4.1c1

2005-03-11 Thread Tim Peters
[Trent Mick] Investigation has turned up that I cannot keep my Python trees straight. That patch *does* fix building PyWin32 against 2.4.1c1. Good! Please send a check for US$1000.00 to the PSF by Monday wink. ___ Python-Dev mailing list

Re: [Python-Dev] sum()

2005-03-11 Thread Tim Peters
FYI, there are a lot of ways to do accurate fp summation, but in general people worry about it too much (except for those who don't worry about it at all -- they're _really_ in trouble 0.5 wink). One clever way is to build on that whenever |x| and |y| are within a factor of 2 of each other, x+y

Re: [Python-Dev] sum()

2005-03-11 Thread Tim Peters
[Tim Peters] ... One clever way is to build on that whenever |x| and |y| are within a factor of 2 of each other, x+y is exact in 754 arithmetic. Ack, I'm fried. Forget that, it's wrong. The correct statement is that x-y is always exact whenever x and y are within a factor of two of each other

Re: [Python-Dev] sum()

2005-03-12 Thread Tim Peters
[Raymond Hettinger] Computing an error term can get the bit back and putting that term back in the input queue restores the overall sum. Right! Once the inputs are exhausted, the components of exp2sum should be exact. Ditto. I'll cover some subtleties below: from math import frexp from

Re: [Python-Dev] Re: distutils fix for building Zope against Python 2.4.1c1

2005-03-12 Thread Tim Peters
[Tim] Don't think it's needed on HEAD. As the checkin comment said: This doesn't appear to be an issue on the HEAD (MSVCCompiler initializes itself via __init__() on the HEAD). I verified by building Zope with unaltered HEAD too, and had no problem with that. [Martin] Are you

Re: [Python-Dev] Open issues for 2.4.1

2005-03-12 Thread Tim Peters
[Anthony Baxter] So here's a list of open items I'm thinking about for the 2.4.1 release. [... sorry, but my editor automatically deletes all paragraphs mentioning problems with Unicode ...] - The unitest changesChanges to unitest to fix subclassing broke Zope's unittests.

Re: [Python-Dev] sum()

2005-03-12 Thread Tim Peters
[Raymond Hettinger] The approach I'm using relies on being able to exactly multiply the 0 or 1 bit error term mantissas by an integer (a count of how many times the term occurs). With a Python dictionary keeping the counts, many steps are saved and the tool becomes much more memory friendly

Re: [Python-Dev] Rationale for sum()'s design?

2005-03-14 Thread Tim Peters
[Eric Nieuwland] Perhaps the second argument should not be optional to emphasise this. After all, there's much more to sum() than numbers. [Greg Ewing] I think practicality beats purity here. Using it on numbers is surely an extremely common case. I'd personally be delighted if sum() never

Re: [Python-Dev] Rationale for sum()'s design?

2005-03-15 Thread Tim Peters
[Guido van Rossum] Um, Python doesn't provide a lot of special support for numbers apart from literals -- sum() should support everything that supports the + operator, just like min() and max() support everything that supports comparison, etc. The discussion in the patch that introduced it

Re: [Python-Dev] Rationale for sum()'s design?

2005-03-15 Thread Tim Peters
[Alex Martelli] I'm reasonably often using sum on lists of datetime.timedelta instances, durations, which ARE summable just like numbers even though they aren't numbers. I believe everything else for which I've used sum in production code DOES come under the general concept of numbers, in

Re: [Python-Dev] Problems with definition of _POSIX_C_SOURCE

2005-03-16 Thread Tim Peters
[Jack Jansen] On a platform I won't mention here I'm running into problems compiling Python, because of it defining _POSIX_C_SOURCE. ... Does anyone know what the real meaning of this define is? LOL. Here's the Official Story:

Re: [Python-Dev] thread semantics for file objects

2005-03-17 Thread Tim Peters
[Jeremy Hylton] Are the thread semantics for file objecst documented anywhere? No. At base level, they're inherited from the C stdio implementation. Since the C standard doesn't even mention threads, that's all platform-dependent. POSIX defines thread semantics for file I/O, but fat lot of

Re: [Python-Dev] thread semantics for file objects

2005-03-17 Thread Tim Peters
[Jeremy Hylton] ... Universal newline reads and get_line() both lock the stream if the platform supports it. So I expect that they are atomic on those platforms. Well, certainly not get_line(). That locks and unlocks the stream _inside_ an enclosing for-loop. Looks quite possible for

Re: [Python-Dev] [AST] Procedure for AST Branch patches

2005-03-20 Thread Tim Peters
[Brett C.] Make sure AST is used in the subject line; e.g., [AST] at the beginning. Unfortunately the AST group is only available for patches; not listed for bug reports (don't know why; can this be fixed?). Your wish is my command: there's an AST group in Python's bug tracker now. FYI, each

Re: [Python-Dev] longobject.c ob_size

2005-04-05 Thread Tim Peters
[Michael Hudson] Asking mostly for curiousity, how hard would it be to have longs store their sign bit somewhere less aggravating? Depends on where that is. It seems to me that the top bit of ob_digit[0] is always 0, for example, Yes, the top bit of ob_digit[i], for all relevant i, is 0 on

[Python-Dev] Re: [Python-checkins] python/dist/src/Modules mathmodule.c, 2.74, 2.75

2005-04-06 Thread Tim Peters
[EMAIL PROTECTED] Modified Files: mathmodule.c Log Message: Add a comment explaining the import of longintrepr.h. Index: mathmodule.c ... #include Python.h -#include longintrepr.h +#include longintrepr.h // just for SHIFT The intent is fine, but please use a standard C (not C++)

Re: [Python-Dev] threading (GilState) question

2005-04-07 Thread Tim Peters
[Michael Hudson] ... Point the first is that I really think this is a bug in the GilState APIs: the readline API isn't inherently multi-threaded and so it would be insane to call PyEval_InitThreads() in initreadline, yet it has to cope with being called in a multithreaded situation. If you

Re: [Python-Dev] Developer list update

2005-04-08 Thread Tim Peters
[Raymond Hettinger] Does anyone know what has become of the following developers and perhaps have their current email addresses? How about we exploit that if someone is a Python developer on SF, they necessarily have an SF email address ($(SFNAME)@users.sourceforge.net, like I'm [EMAIL

Re: [Python-Dev] Developer list update

2005-04-08 Thread Tim Peters
[Jeremy] Eric Price did some of the work on the decimal package, which was only two summers ago. He wasn't an intern at CNRI. [Fred] A different Eric Price, then. Mea culpa. (Or am I misremembering the intern's name? Hmm.) Yes, Eric Price was the PythonLabs intern, for the brief time

Re: [Python-Dev] Developer list update

2005-04-08 Thread Tim Peters
... [Uncle Bad Cop Timmy] Then, IMO, if someone with SF commit privs can't be reached via their SF address, they shouldn't have SF commit privs. [Raymond Good Cop Hettinger] I'm taking a lighter approach and making every effort to get in contact. If they respond, I'll ask them to update

Re: [Python-Dev] marshal / unmarshal

2005-04-08 Thread Tim Peters
[Scott David Daniels] What should marshal / unmarshal do with floating point NaNs (the case we are worrying about is Infinity) ? The current behavior is not perfect. All Python behavior in the presence of a NaN, infinity, or signed zero is a platform-dependent accident. This is because C89

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-10 Thread Tim Peters
marshal shouldn't be representing doubles as decimal strings to begin with. All code for (de)serialing C doubles should go thru _PyFloat_Pack8() and _PyFloat_Unpack8(). cPickle (proto = 1) and struct (std mode) already do; marshal is the oddball. But as the docs (floatobject.h) for these say:

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-10 Thread Tim Peters
[mwh] OTOH, the implementation has this comment: /* * _PyFloat_{Pack,Unpack}{4,8}. See floatobject.h. * * TODO: On platforms that use the standard IEEE-754 single and double * formats natively, these routines

Re: [Python-Dev] Re: Re: marshal / unmarshal

2005-04-10 Thread Tim Peters
[Fredrik Lundh] is changing the marshal format really the right thing to do at this point? I don't see anything special about this point -- it's just sometime between 2.4.1 and 2.5a0. What do you have in mind? Like pickle formats, I expect a change to marshal would add a new format code, not

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-11 Thread Tim Peters
[Tim] The 754 standard doesn't say anything about how the difference between signaling and quiet NaNs is represented. So it's possible that a qNaN on one box would look like an sNaN on a different box, and vice versa. But since most people run with all FPU traps disabled, and Python doesn't

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-11 Thread Tim Peters
... [mwh] OK, so the worst that could happen here is that moving marshal data from one box to another could turn one sort of NaN into another? Right. Assuming source and destination boxes both use 754 format, and the implementation adjusts endianess if necessary. Heh. I have a vague

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-11 Thread Tim Peters
[Michael Hudson] I've just submitted http://python.org/sf/1180995 which adds format codes for binary marshalling of floats if version 1, but it doesn't quite have the effect I expected (see below): inf = 1e308*1e308 nan = inf/inf marshal.dumps(nan, 2) Traceback (most recent call last):

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-12 Thread Tim Peters
... [mwh] I recall stories of machines that stored the bytes of long in some crazy order like that. I think Python would already be broken on such a system, but, also, don't care. [Tim] Python does very little that depends on internal native byte order, and C hides it in the absence of

[Python-Dev] Newish test failures

2005-04-20 Thread Tim Peters
Seeing three seemingly related test failures today, on CVS HEAD: test_csv test test_csv failed -- errors occurred; run in verbose mode for details test_descr test test_descr crashed -- exceptions.AttributeError: attribute '__dict__' of 'type' objects is not writable test_file test test_file

Re: [Python-Dev] PEP 340 -- concept clarification

2005-05-03 Thread Tim Peters
[Tim] Because Queue does use condvars now instead of plain locks, I wouldn't approve of any gimmick purporting to hide the acquire/release's in put() or get(): that those are visible is necessary to seeing that the _condvar_ protocol is being followed (must acquire() before wait(); must be

Re: [Python-Dev] Pre-PEP: Unifying try-except and try-finally

2005-05-04 Thread Tim Peters
[Guido] I'm +1 on accepting this now -- anybody against? I'm curious to know if you (Guido) remember why you removed this feature in Python 0.9.6? From the HISTORY file: New features in 0.9.6: - stricter try stmt syntax: cannot mix except and finally clauses on 1 try IIRC (and I may well

Re: [Python-Dev] Pre-PEP: Unifying try-except and try-finally

2005-05-04 Thread Tim Peters
[Shane Holloway] And per the PEP, I think the explaining that:: try: A except: B else: C finally: D is *exactly* equivalent to:: try: try: A except: B else: C

Re: [Python-Dev] PEP 340 - Remaining issues - keyword

2005-05-06 Thread Tim Peters
[Guido] ... I wonder how many folks call their action methods do() though. A little Google(tm)-ing suggests it's not all that common, although it would break Zope on NetBSD: http://www.zope.org/Members/tino/ZopeNetBSD I can live with that wink.

Re: [Python-Dev] Tidier Exceptions

2005-05-13 Thread Tim Peters
[Guido, on string exceptions] ... Last I looked Zope 2 still depended on them (especially in the bowels of ZODB); maybe Tim Peters knows if that's still the case. Certainly none of that in ZODB, or in ZRS. Definitely some in Zope 2.6: http://mail.zope.org/pipermail/zope-tests/2005-May

Re: [Python-Dev] [Python-checkins] python/nondist/peps pep-0343.txt, 1.11, 1.12

2005-05-17 Thread Tim Peters
[Raymond Hettinger] ... One more change: The final return +s should be unindented. It should be at the same level as the do with_extra_precision(). The purpose of the +s is to force the result to be rounded back to the *original* precision. This nuance is likely to be the bane of folks

Re: [Python-Dev] Combining the best of PEP 288 and PEP 325: generator exceptions and cleanup

2005-05-19 Thread Tim Peters
[Guido] ... I think in the past I've unsuccessfully tried to argue that if a cycle contains exactly one object with a Python-invoking finalizer, that finalizer could be invoked before breaking the cycle. I still think that's a sensible proposal, and generators may be the use case to finally

Re: [Python-Dev] Combining the best of PEP 288 and PEP 325: generator exceptions and cleanup

2005-05-19 Thread Tim Peters
[Phillip J. Eby] ... However, Tim's new post brings up a different issue: if the collector can't tell the difference between a cycle participant and an object that's only reachable from a cycle, then the mere existence of a generator __del__ will prevent the cycle collection of the entire

Re: [Python-Dev] Combining the best of PEP 288 and PEP 325: generator exceptions and cleanup

2005-05-19 Thread Tim Peters
[Phillip J. Eby] Now you've shaken my faith in Uncle Timmy. :) Now, now, a mere technical matter is no cause for soul-damning heresy! Seriously, he did *say*: For example, it doesn't know the difference between an object that's in a trash cycle, and an object that's not in a trash cycle

Re: [Python-Dev] Adventures with Decimal

2005-05-19 Thread Tim Peters
[Raymond Hettinger] For brevity, the above example used the context free constructor, but the point was to show the consequence of a precision change. Yes, I understood your point. I was making a different point: changing precision isn't needed _at all_ to get surprises from a constructor

Re: [Python-Dev] Adventures with Decimal

2005-05-19 Thread Tim Peters
Sorry, I simply can't make more time for this. Shotgun mode: [Raymond] I have no such thoughts but do strongly prefer the current design. How can you strongly prefer it? You asked me whether I typed floats with more than 28 significant digits. Not usually wink. Do you? If you don't

Re: [Python-Dev] [Python-checkins] python/nondist/peps pep-0343.txt, 1.11, 1.12

2005-05-19 Thread Tim Peters
[Greg Ewing] I don't see it's because of that. Even if D(whatever) didn't ignore the context settings, you'd get the same oddity if the numbers came from somewhere else with a different precision. Most users don't change context precision, and in that case there is no operation defined in the

Re: [Python-Dev] Adventures with Decimal

2005-05-20 Thread Tim Peters
[Michael Chermside] Tim, I find Raymond's arguments to be much more persuasive. (And that's even BEFORE I read his 11-point missive.) I understood the concept that *operations* are context- dependent, but decimal *objects* are not, and thus it made sense to me that *constructors* were not

Re: [Python-Dev] Adventures with Decimal

2005-05-20 Thread Tim Peters
[Tim Peters] ... Other important implementations of the standard didn't make this mistake; for example, Java's BigDecimal (java.lang.String) constructor follows the rules here: http://www2.hursley.ibm.com/decimalj/deccons.html Hmm -- or maybe it doesn't! The text says

Re: [Python-Dev] Adventures with Decimal

2005-05-20 Thread Tim Peters
[Raymond Hettinger] The word deviate inaccurately suggests that we do not have a compliant method which, of course, we do. There are two methods, one context aware and the other context free. The proposal is to change the behavior of the context free version, treat it as a bug, and alter it

  1   2   3   4   5   6   7   8   9   >