Re: [Python-Dev] [Python-3000] Mini Path object

2006-11-05 Thread Greg Ewing
hout any noise characters in them. -- Greg ___ 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: [Python-Dev] Importing .pyc in -O mode and vice versa

2006-11-05 Thread Greg Ewing
made? Also, cacheing isn't the only thing to consider. Last time I looked at the implementation of unix file systems, they mostly seemed to do directory lookups by linear search. Unless that's changed a lot, I have a hard time seeing how that's going to beat Python's high

Re: [Python-Dev] idea for data-type (data-format) PEP

2006-11-05 Thread Greg Ewing
sing a datatype with a user-supplied dispatch table? -- Greg ___ 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: [Python-Dev] Importing .pyc in -O mode and vice versa

2006-11-06 Thread Greg Ewing
ct the vast majority of Python programs don't need to track changes to the set of importable modules during execution. The exceptions would be things like IDEs, and they could do a cache flush before reloading a module, etc. -- Greg ___ Python-Dev

Re: [Python-Dev] Importing .pyc in -O mode and vice versa

2006-11-07 Thread Greg Ewing
cache > files used internally by the interpreter for speed reasons only, and > bytecode files that can be shipped and imported. That's a possibility. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/li

Re: [Python-Dev] Importing .pyc in -O mode and vice versa

2006-11-07 Thread Greg Ewing
you think the file is in. That might wipe out most of the advantage. It would be different on platforms which provide a way of "watching" a directory and getting notified of changes. I think MacOSX, Linux and Windows all provide some way of doing that nowadays, although I'm not f

Re: [Python-Dev] Importing .pyc in -O mode and vice versa

2006-11-07 Thread Greg Ewing
to import it for the first time. So I don't think there would be any visible change as far as most people could tell. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://ma

Re: [Python-Dev] Importing .pyc in -O mode and vice versa

2006-11-08 Thread Greg Ewing
fine, else the module doesn't exist. BTW, I'm not thinking of cacheing individual directories, but scanning all the directories and building a single qualified_module_name -> pathname mapping. If the cache gets invalidated, all the directories along the path are re-scanned, so a ne

Re: [Python-Dev] Python and the Linux Standard Base (LSB)

2006-11-29 Thread Greg Ewing
n-hidden location such as ~/local seems just as good and less magical to me. -- Greg ___ 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: [Python-Dev] Python and the Linux Standard Base (LSB)

2006-11-30 Thread Greg Ewing
applications or libraries or whatever are even there in the first place. You've got all this disk space being used up, but no way of seeing where or by what, and no obvious way of freeing it up. I think that's bad HCI. -- Greg ___ Python-D

Re: [Python-Dev] a feature i'd like to see in python #2: indexing of match objects

2006-12-03 Thread Greg Ewing
Steve Holden wrote: > So the subgroups are numbered starting from > 1 and subgroup 0 is a special case which returns the whole match. But the subgroups can be nested too, so it's not really as special as all that. -- Greg ___ Python-Dev m

Re: [Python-Dev] [NPERS] Re: a feature i'd like to see in python #2: indexing of match objects

2006-12-04 Thread Greg Ewing
be better, e.g. m.range --> the whole match m.subgroups[i] --> another match object with its own range and subgroups attributes -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman

Re: [Python-Dev] LSB: Binary compatibility

2006-12-05 Thread Greg Ewing
Could backwards compatibility concerns be addressed by including more than one version of Python in the LSB? Python already allows multiple versions to coexist, so applications targeting the LSB would just need to be explicit about which version of the interpreter to launch. -- Greg

Re: [Python-Dev] Threading, atexit, and logging

2006-12-07 Thread Greg Ewing
has something to do with threading, whereas the atexit mechanism could get screwed up by someone who wasn't even thinking about what effect it might have on threading. -- Greg Ewing, Computer Science Dept, +--+ University of Canterbury,

Re: [Python-Dev] Problem with signals in a single threaded application

2007-01-26 Thread Greg Ewing
as well if you want, but it's not strictly necessary. -- Greg ___ 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: [Python-Dev] Problem with signals in a single threaded application

2007-01-26 Thread Greg Ewing
he operating system is doing certain things to > the application (including, sometimes, when it is swapped out or > deep in I/O.) That sounds like an outright bug. I can't think of any earthly reason why the handler shouldn't be called eventually, if it remains installed and the pro

Re: [Python-Dev] Object creation hook

2007-01-26 Thread Greg Ewing
method would call it. -- Greg ___ 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: [Python-Dev] Problem with signals in a single threaded application

2007-01-27 Thread Greg Ewing
Martin v. Löwis wrote: > Greg Ewing schrieb: > >>>Please >>>try to come up with a patch (e.g. by putting a while(is_tripped) loop >>>around the for loop). >> >>That isn't going to fix it. > > Why not? Correct me if I'm wrong, but w

Re: [Python-Dev] [Python-3000] Unipath package

2007-01-28 Thread Greg Ewing
say that translation of absolute paths is not supported in general. -- Greg Ewing, Computer Science Dept, +--+ University of Canterbury, | Carpe post meridiem! | Christchurch, New Zealand

Re: [Python-Dev] [Python-3000] Unipath package

2007-01-28 Thread Greg Ewing
m, in which case Unix paths are used for both, or the Unix file system must be mounted on the Windows system, in which case they're both Windows paths. In neither case is a conversion from Unix to Windows pathnames needed. -- Greg Ewing, Computer Science Dept, +

Re: [Python-Dev] Shortcut Notation for Chaining Method Calls

2007-02-03 Thread Greg Ewing
as compact and doesn't suffer from the weirdness of passing method names in as quoted strings. -- Greg ___ 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: [Python-Dev] Shortcut Notation for Chaining Method Calls

2007-02-03 Thread Greg Ewing
imes before. It was a deliberate decision to have those methods return None, because it makes it clear that they operate in-place. I doubt that Guido's thinking on that has changed at all. -- Greg ___ Python-Dev mailing list Python-Dev@python.org htt

Re: [Python-Dev] Changing a value in a frame (for a debugger)

2007-02-06 Thread Greg Ewing
ks like you're out of luck. -- Greg ___ 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: [Python-Dev] Changing a value in a frame (for a debugger)

2007-02-07 Thread Greg Ewing
function that uses an array for locals. -- Greg ___ 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: [Python-Dev] Why is nb_inplace_power ternary?

2007-02-08 Thread Greg Ewing
st leaving nb_inplace_pow null, so I suppose that's not necessary. Might we want to add an in-place version of the 3-arg pow() function one day? If so, leaving the third argument there could be useful. -- Greg ___ Python-Dev mailing l

Re: [Python-Dev] Why is nb_inplace_power ternary?

2007-02-09 Thread Greg Ewing
Martin v. Löwis wrote: > Greg Ewing schrieb: > >> Might we want to add an in-place version of the 3-arg >> pow() function one day? > > What could the syntax for that be? It wouldn't be a syntax, just a function, e.g. ipow(x, n, 10) > Also, it would break e

Re: [Python-Dev] New syntax for 'dynamic' attribute access

2007-02-12 Thread Greg Ewing
by a dict? In my experience, the amount of code which truly needs to use getattr is extremely small. -- Greg Ewing, Computer Science Dept, +--+ University of Canterbury, | Carpe post meridiem! | Christchurch, New Zealand |

Re: [Python-Dev] New syntax for 'dynamic' attribute access

2007-02-12 Thread Greg Ewing
rect call to the __getattr__ method, or maybe even have a new opcode for doing that. In other words, "special syntax" doesn't necessarily have to look like special syntax. :-) -- Greg ___ Python-Dev mailing list Python-Dev@python.or

Re: [Python-Dev] New syntax for 'dynamic' attribute access

2007-02-12 Thread Greg Ewing
big step, and it needs a very solid reason to jusify it. I don't see this filling a use case that's anywhere near common enough to reach that threshold. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman

Re: [Python-Dev] Trial balloon: microthreads library in stdlib

2007-02-12 Thread Greg Ewing
dea. It's downright silly having each thing that uses async I/O doing its own thing. There should be a standard mechanism in the stdlib that everything can use. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mai

Re: [Python-Dev] Trial balloon: microthreads library in stdlib

2007-02-12 Thread Greg Ewing
't want to follow that path anyway -- because the end result would be too convoluted for ordinary people to understand and maintain. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-

Re: [Python-Dev] Interning string subtype instances

2007-02-12 Thread Greg Ewing
ows when both strings are interned, so it can compare them quickly whether they are equal or not. Your version could detect equal strings quickly, but not unequal strings. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/ma

Re: [Python-Dev] Summary of "dynamic attribute access" discussion

2007-02-13 Thread Greg Falcon
return wrapper objects, which provide a different interface to the same data, and which can be used to mutate the underlying objects. Aren't the set of ailasing concerns in these two cases exactly the same? +1 for attrview(), +0 for .[] syntax. (-1 for .[] if attrview() is accepted.) Greg

Re: [Python-Dev] Recent experience with the _ast module

2007-02-13 Thread Greg Ewing
Brett Cannon wrote: > On 2/12/07, Collin Winter <[EMAIL PROTECTED]> wrote: > > 2) {BinOp,AugAssign,BoolOp,etc}.op > > I can't think of a reason, off the top of my head, why they can't be > singletons. Why not j

Re: [Python-Dev] Trial balloon: microthreads library in stdlib

2007-02-13 Thread Greg Ewing
Martin v. Löwis wrote: > Greg Ewing schrieb: > > the end result would be too > > convoluted for ordinary people to understand and maintain. > > That very much depends on what the end result would be. True. What I should have said is that Guido *believes* the outcome wo

Re: [Python-Dev] New syntax for 'dynamic' attribute access

2007-02-13 Thread Greg Ewing
of YAGNIOE (You Aren't Going to Need It Often Enough). -- Greg ___ 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: [Python-Dev] New syntax for 'dynamic' attribute access

2007-02-13 Thread Greg Ewing
as getattr(a, 42), which depends on a's __getattr__ implementation. -- Greg ___ 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: [Python-Dev] Trial balloon: microthreads library in stdlib

2007-02-13 Thread Greg Ewing
Steve Holden wrote: > I know that there's work in progress (and indeed > almost complete) to put Stackless into 2.5 It might be less confusing to rename the current version of Stackless to "microthreads" or something, since it's not really

Re: [Python-Dev] Interning string subtype instances

2007-02-13 Thread Greg Ewing
ate method, you can just use 'is' to compare them. -- Greg ___ 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: [Python-Dev] New syntax for 'dynamic' attribute access

2007-02-13 Thread Greg Ewing
rary choice, but to me it just seems that the dot and bracket *should* be separare tokens, perhaps because I would be thinking of the [x] as a special kind of argument to the dot operator, rather than there being a funny new operator called ".[". -- Greg

Re: [Python-Dev] Summary of "dynamic attribute access" discussion

2007-02-13 Thread Greg Ewing
a line by itself, with no sub-expressions, i.e. try: x = getattr(obj, name) except AttributeError: ... else: ... If you're doing that, I see no significant lack of readability in the getattr call that needs to be remedied. So I

Re: [Python-Dev] Summary of "dynamic attribute access" discussion

2007-02-13 Thread Greg Ewing
alled getattr. :-) -- Greg ___ 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: [Python-Dev] Summary of "dynamic attribute access" discussion

2007-02-13 Thread Greg Ewing
Josiah Carlson wrote: > In a recent > source checkout of the trunk Lib, there are 100+ uses of setattr, 400+ > uses of getattr ... and a trivial number of delattr calls. That's out of about 250,000 lines, or 0.2%. Not a huge proportion, I would have tho

Re: [Python-Dev] Summary of "dynamic attribute access" discussion

2007-02-13 Thread Greg Ewing
Mike Klaas wrote: > As a comparison, enumerate (that I would have believed was much more > frequent a priori), is used 67 times, and zip/izip 165 times. By that argument, we should be considering a special syntax for zip and izip before getattr. -

Re: [Python-Dev] Summary of "dynamic attribute access" discussion

2007-02-13 Thread Greg Ewing
n seq2): ... -- Greg ___ 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: [Python-Dev] Trial balloon: microthreads library in stdlib

2007-02-13 Thread Greg Ewing
se its own special event mechanism, and everything else needs to be modified to suit its requirements, then it's part of the problem, not part of the solution. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailm

Re: [Python-Dev] Recent experience with the _ast module

2007-02-13 Thread Greg Ewing
aster) to use an array to go from C enum --> some object, which could as well be an interned string as anything else. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http:

Re: [Python-Dev] New syntax for 'dynamic' attribute access

2007-02-13 Thread Greg Ewing
Guido van Rossum wrote: > But if we ever turn it into a single token (which we just may for > Py3k) don't complain if your code breaks. I won't. I always treat it as a single token anyway, unless I'm entering an obfuscated python comp

Re: [Python-Dev] Interning string subtype instances

2007-02-13 Thread Greg Ewing
Martin v. Löwis wrote: > Greg Ewing schrieb: > > > The string comparison method knows when both > > strings are interned > > No, it doesn't - see stringobject.c:string_richcompare. Well, I'm surprised and confused. It's certainly possible to tell v

Re: [Python-Dev] [Python-3000] pre-PEP: Default Argument Expressions

2007-02-14 Thread Greg Ewing
treme instance of this: > def bar(b=my_sum((["b"] * (2 * 3))[:4])): > print b -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailm

Re: [Python-Dev] Trial balloon: microthreads library in stdlib

2007-02-14 Thread Greg Ewing
Jean-Paul Calderone wrote: > Greg, productive discussion is not furthered by the > unsupported statement of one position or another. Sorry, I'll expand on that a bit. The "problem" I was referring to is the turf wars between all the event-driven frameworks that all want t

Re: [Python-Dev] Twisted Isn't Specific (was Re: Trial balloon: microthreads library in stdlib)

2007-02-14 Thread Greg Ewing
acks. The choice of implementation should be made somewhere deep inside the library, based on what platform is being used. So at this point I'm skeptical that the Twisted API for these things should be adopted as-is. -- Greg ___ Python-Dev mailing li

Re: [Python-Dev] Trial balloon: microthreads library in stdlib

2007-02-14 Thread Greg Ewing
[EMAIL PROTECTED] wrote: > sounded like > monkeypatching the socket and asyncore modules to provide asynchronous > file I/O based on the platform-specific IOCP API for Windows. I don't think anyone's suggesting that any long-term solution to all this would involve monke

Re: [Python-Dev] Recent experience with the _ast module

2007-02-14 Thread Greg Ewing
return Or_singleton; Well, And_singleton and Or_singleton could be anything, including integers or interned strings. Creating a class and then a singleton instance for each one seems like overkill and unnecessary bloat to me. -- Greg ___ Python-Dev ma

Re: [Python-Dev] Summary: rejection of 'dynamic attribute' syntax

2007-02-14 Thread Greg Ewing
Steve Holden wrote: > A further data point is that modern machines seem to give timing > variabilities due to CPU temperature variations even if you always eat > exactly the same thing. Oh, great. Now we're going to have to run our benchmarks in a temperature-controlled ov

Re: [Python-Dev] Why is nb_inplace_power ternary?

2007-02-14 Thread Greg Ewing
it might return a new object. So the return value conveys useful information, unlike with list.sort() et al. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/m

Re: [Python-Dev] Interning string subtype instances

2007-02-14 Thread Greg Ewing
rown interning might not give the same results in all cases. -- Greg ___ 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: [Python-Dev] Interning string subtype instances

2007-02-14 Thread Greg Ewing
7;re not equal. But as has been pointed out, unless you're very unlucky, you find out pretty fast when they're not equal. So I'm happy now. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/p

Re: [Python-Dev] Twisted Isn't Specific (was Re: Trial balloon: microthreads library in stdlib)

2007-02-14 Thread Greg Ewing
for adoption as-is this doesn't add to the discussion. Okay, but one of the suggestions made seemed to be "why not just use the Twisted API". I'm putting forward a possible reason. -- Greg ___ 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: [Python-Dev] Twisted Isn't Specific (was Re: Trial balloon: microthreads library in stdlib)

2007-02-14 Thread Greg Ewing
bstrate on any given platform. Then they can coexist without the need for any top-level choices. I know that will be hard to do, but it's the only way out of this mess that I can see. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http:/

Re: [Python-Dev] Twisted Isn't Specific (was Re: Trial balloon: microthreads library in stdlib)

2007-02-14 Thread Greg Ewing
*don't* have to use threads. And... how do you run multiple event loops simultaneously in the *same* thread? That sounds self-contradictory to me. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/p

Re: [Python-Dev] Twisted Isn't Specific (was Re: Trial balloon: microthreads library in stdlib)

2007-02-14 Thread Greg Ewing
Thomas Wouters wrote: > If all (or all-but-one) of them have a 'run one iteration' method, you > can call that from the 'main' mainloop. But without some way of blocking until an event arrives for *either* loop, you have to resort to some kind of busy polling, whic

Re: [Python-Dev] Twisted Isn't Specific (was Re: Trial balloon: microthreads library in stdlib)

2007-02-14 Thread Greg Ewing
the standard, then it would give people some guidance as to how to write future event-driven code. -- Greg ___ 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: [Python-Dev] Twisted Isn't Specific (was Re: Trial balloon: microthreads library in stdlib)

2007-02-15 Thread Greg Ewing
t mechanism, there's no need to use the gtk event loop for these things -- you can just use the central event mechanism directly. The pygtk APIs for setting these up can redirect them to the appropriate place, to accommodate existing code that uses t

Re: [Python-Dev] New syntax for 'dynamic' attribute access

2007-02-15 Thread Greg Ewing
n the desert, but not so good at winning a horse race (not camel race). Which is the point of the saying. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/ma

Re: [Python-Dev] Summary: rejection of 'dynamic attribute' syntax

2007-02-15 Thread Greg Ewing
s. So we need to standardise latitude/longitude/altitude, time of year and phase of moon. Better check atmospheric pressure and humidity, too, just to be on the safe side. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.or

Re: [Python-Dev] generic async io (was: microthreading vs. async io)

2007-02-15 Thread Greg Ewing
Nick Maclaren wrote: > Threading > - > > An I/O operation passes a buffer, length, file and action and receives a > token back. You seem to be using the word "threading" in a completely different way than usual here, which may be causing

Re: [Python-Dev] Wrapping up 'dynamic attribute' discussion

2007-02-15 Thread Greg Falcon
be enumerated. Therefore, it technically does not implement a mapping. Once Python grows a __dir__ special method, it's possible I could be convinced this is the wrong choice, but I'm not sure of that. Greg F ___ Python-Dev mailing list Python

Re: [Python-Dev] A "record" type (was Re: Py2.6 ideas)

2007-02-21 Thread Greg Ewing
with a tuple subclass and add descriptors to provide named access. If the descriptor is implemented in C it should be just as efficient as using __slots__, but with no duplication of the references. Given a suitable descriptor type, it shouldn't be hard to write a factory function to assemble such

Re: [Python-Dev] bool conversion wart?

2007-02-23 Thread Greg Ewing
he beginning, it probably would have been a separate type altogether. Hmmm... is that something that should be revisited in 3.0? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Un

Re: [Python-Dev] bool conversion wart?

2007-02-23 Thread Greg Ewing
Martin v. Löwis wrote: > One idiom that people use a lot is foo[b], where > b is a boolean. Could that be addressed using the new __index__ mechanism? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/li

Re: [Python-Dev] bool conversion wart?

2007-02-25 Thread Greg Ewing
left over for historical reasons. Those people are mystified as to why anyone would *want* a boolean to behave like an int. Personally I'm +0 on this. I wouldn't object if it happened, but I'm not pushing for it. -- Greg ___ Python-Dev

Re: [Python-Dev] Python-3000 upgrade path

2007-02-25 Thread Greg Ewing
time you want. I've been careful to avoid tab-space mixing ever since my earliest uses of Python. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mai

Re: [Python-Dev] Python-3000 upgrade path

2007-02-26 Thread Greg Ewing
Stephen J. Turnbull wrote: > RKN = reverse Knuth numbering? No, for RKN you'd have to start with 3141.5926... (an infinite number of digits following) and drop one off the end each time... although it would take rather a long time to get to the final release then. :-(

Re: [Python-Dev] with_traceback

2007-02-26 Thread Greg Ewing
egitimate reasons for wanting to pre-create exceptions, e.g. if I'm intending to raise and catch a particular exception frequently and I don't want the overhead of creating a new instance each time. For me, this is casting serious doubt on the whole idea

[Python-Dev] Integer division operator can give float result?

2007-02-27 Thread Greg Ewing
Is this intentional? I would have expected the // operator to always give an integer result. Python 2.3 (#1, Aug 5 2003, 15:52:30) [GCC 3.1 20020420 (prerelease)] on darwin Type "help", "copyright", "credits" or "license" for more

Re: [Python-Dev] with_traceback

2007-02-28 Thread Greg Ewing
to make the obvious way wrong for subtle reasons. That doesn't seem pythonic to me. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/py

Re: [Python-Dev] with_traceback

2007-02-28 Thread Greg Ewing
Adam Olsen wrote: > It sounds like we should always copy the exception given to raise, I don't like that either, for all the reasons that make it infeasible to copy an arbitrary object in a general way. -- Greg ___ Python-Dev mailing list Py

Re: [Python-Dev] with_traceback

2007-02-28 Thread Greg Ewing
believe calling copy.copy() would be sufficient. I never use that, because I have no confidence that it would DWIM. I'd be unhappy if the system started relying on it anywhere fundamental. -- Greg Ewing, Computer Science Dept, +--+ University of

Re: [Python-Dev] with_traceback

2007-02-28 Thread Greg Ewing
l create a new exception instance and then make a copy of it", unless this can be optimised away somehow, and it's not necessarily obvious that the refcount == 1 trick will work (it depends on the exact details of how the references flow through the exception raising machinery). -- Greg Ewin

Re: [Python-Dev] with_traceback

2007-02-28 Thread Greg Ewing
define classes, since creating one involves setting up a dict, etc. And if you use __slots__ you end up with objects of different sizes, which isn't free-list-friendly. -- Greg Ewing, Computer Science Dept, +--+ University of Canterbury, |

Re: [Python-Dev] with_traceback

2007-03-01 Thread Greg Ewing
also be considerably *more* expensive to implement than the current scheme, because it would require copying the entire stack, instead of just linking stack frames together as they are unwound during the search for an exception handler. -- Greg ___

Re: [Python-Dev] with_traceback

2007-03-01 Thread Greg Ewing
d raising the same instance. There's also the possibility of a traceback unexpectedly kept alive causing GC problems -- cycles, files not closed when you expect, etc. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.pyth

Re: [Python-Dev] with_traceback

2007-03-01 Thread Greg Ewing
call it a 'catch' (used as a noun, as when a fisherman might say "That's a good catch!") -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.pyt

Re: [Python-Dev] with_traceback

2007-03-01 Thread Greg Ewing
27;s no memory to allocate a traceback object, so you raise a MemoryError... etc... That might be a reason for pre-allocating the MemoryError exception, too. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listi

Re: [Python-Dev] except Exception as err, tb [was: with_traceback]

2007-03-02 Thread Greg Ewing
for that rather than using a 2-tuple. -- Greg ___ 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

[Python-Dev] Another traceback idea [was: except Exception as err, tb]

2007-03-02 Thread Greg Ewing
k' clauses in both cases. However, the apparent instantiation call wouldn't be made -- it's just part of the syntax. -- Greg ___ 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: [Python-Dev] Another traceback idea [was: except Exception as err, tb]

2007-03-02 Thread Greg Ewing
u can still raise a preinstantiated exception, it wouldn't be safe to attach a traceback to it, meaning we'd have to support two different ways of handling tracebacks as well. It could all get terribly messy. -- Greg ___ Python-Dev mailing list Pytho

Re: [Python-Dev] PEP 344 (was: with_traceback)

2007-03-02 Thread Greg Ewing
ion context" object that can hold other info. -- Greg ___ 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: [Python-Dev] with_traceback

2007-03-02 Thread Greg Ewing
Michael Foord wrote: > Greg Ewing wrote: > > > An exception caught and raised in one thread would > > be vulnerable to having its traceback clobbered by > > another thread raising the same instance. > > Right - but that would still be *no worse* than the current situ

Re: [Python-Dev] PEP 344 (was: with_traceback)

2007-03-02 Thread Greg Ewing
ther instantiating if it's a class and gets caught with except E: or except E with context: -- Greg ___ 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: [Python-Dev] with_traceback

2007-03-02 Thread Greg Ewing
s cleaner, not more messy. -- Greg ___ 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: [Python-Dev] PEP 344 (was: with_traceback)

2007-03-02 Thread Greg Ewing
g. (Assuming we get rid of traceback objects and just link the frames together directly.) -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options

Re: [Python-Dev] PEP 344 (was: with_traceback)

2007-03-02 Thread Greg Ewing
r raising and reraising? Raising would complain if there were already a traceback, and reraising would expect an existing traceback and extend it. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/p

Re: [Python-Dev] locals(), closures, and IronPython...

2007-03-06 Thread Greg Ewing
n=None, Emin=None, Emax=None, capitals=None, _clamp=0, _ignored_flags=None) args.update(kwds) for name, value in args: ... So, no need for locals() here. -- Greg __

Re: [Python-Dev] splitext('.cshrc')

2007-03-06 Thread Greg Ewing
'm not sure if that's an argument for or against the patch, though. It *might* be an argument for making the behaviour platform-dependent. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/pytho

Re: [Python-Dev] Lack of sequential decompression in the zipfile module

2007-03-07 Thread Greg Ewing
ng should be a problem. > Or, if you need to open more than > one member file for writing in the same zip file, then this is not > possible at all. I don't think it would be unreasonable to just not support writing to more than one member at a time. -- Greg __

Re: [Python-Dev] Adding socket timeout to urllib2

2007-03-07 Thread Greg Ewing
Bill Janssen wrote: > If you really need a name other than "timeout" (which seems fine to > me), how about "waiting-with-mild-trepidation-timeout"? Something like "response timeout" might be more descriptive. -- Greg __

Re: [Python-Dev] Policy Decisions, Judgment Calls, and Backwards Compatibility (was Re: splitext('.cshrc'))

2007-03-09 Thread Greg Ewing
y string for ext... -- Greg ___ 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: [Python-Dev] datetime module enhancements

2007-03-09 Thread Greg Ewing
e and get the same result when subtracting two dates, as long as you pick the same one for both dates. So it's not really assuming anything here. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listi

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