Re: [Python-Dev] Python-Dev Digest, Vol 69, Issue 143

2009-04-16 Thread Greg Ewing
-associative, which is a much rarer and more surprising thing. We do at least have ('1' + '2') + '3' == '1' + ('2' + '3') -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.py

Re: [Python-Dev] #!/usr/bin/env python --> python3 where applicable

2009-04-18 Thread Greg Ewing
faded into the sunset, we can start aliasing 'python' to 'python3' if we want, can't we? -- 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] #!/usr/bin/env python --> python3 where applicable

2009-04-18 Thread Greg Ewing
altinstall and fullinstall that aliases 'python3' but not 'python', and make that the default. Maybe call it 'install3'. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo

Re: [Python-Dev] yield from?

2009-05-03 Thread Greg Ewing
own, and is awaiting a verdict from Guido. The prototype implementation doesn't quite match the PEP in some of the fine details yet. Also it's for 2.6 rather than 3.x; someone with more knowledge of 3.x internals would be better placed than me to convert it. -- Greg __

[Python-Dev] Building types programmatically (was: drop unnecessary "context" pointer from PyGetSetDef)

2009-05-04 Thread Greg Ewing
think Ruby's extension API is ahead in this particular area. -- 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] special method lookup: how much do we care?

2009-05-09 Thread Greg Ewing
__reduce__, etc. -- 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] Shorter release schedule?

2009-05-12 Thread Greg Ewing
MRAB wrote: Next you'll be saying that they should be named after years. Python 2010, anyone? :-) To keep people on their toes, we should switch to a completely random new naming scheme with every release, like Microsoft has been doing with Windows. --

Re: [Python-Dev] Survey on DVCS usage and experience

2009-05-30 Thread Greg Ewing
Antoine Pitrou wrote: you can't be sure all the responders are over 18. Actually, they might even not be human beings! (hint: I'm not) Not over 18, or not a human being? -- Greg ___ Python-Dev mailing list Python-Dev@pytho

Re: [Python-Dev] Indentation oddness...

2009-05-30 Thread Greg Ewing
is that the REPL needs to keep reading lines until it gets a completely blank one. I don't see why the compiler has to treat the source any differently once the REPL has decided how much text to feed it. -- Greg ___ Python-Dev mailing list Python-De

Re: [Python-Dev] Issues with process and discussions (Re: Issues with Py3.1's new ipaddr)

2009-06-03 Thread Greg Ewing
umber of sources, and I don't usually pay much attention to exactly where they're coming from. I just hit reply-all and trust that it will go somewhere sensible. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/m

Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-13 Thread Greg Ewing
when dealing with buffered streams. -- 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] ctime: I don't think that word means what you think it means.

2009-06-13 Thread Greg Ewing
s "creation" are still likely to confuse them. Why not give it a more explicit name, such as "st_creationtime"? -- 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] io.BufferedReader.peek() Behaviour in python3.1

2009-06-14 Thread Greg Ewing
Cameron Simpson wrote: For myself, I'd expect more often to want to see if there's stuff in the buffer _without_ doing any raw reads at all. What uses do you have in mind for that? -- Greg ___ Python-Dev mailing list Python-Dev@pytho

Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-15 Thread Greg Ewing
don't play well with other things like select(). Anyhow, I wouldn't be opposed to having a way of looking into the buffer, but it should be a separate API -- preferably with a better name than peek0(), which gives no clue at all about what it does differently from p

Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-16 Thread Greg Ewing
as peek() that doesn't explicitly mention the buffer should fit into the abstraction properly. -- 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] Functions that steal references (Re: [pygame] [patch] minor memory leaks...)

2009-06-16 Thread Greg Ewing
PyModule_AddObject an oddity? I ask because I've been thinking about adding features to Pyrex for dealing with stolen references, and it could be important to know things like this. Also, if it's an oddity, it would be a good idea to mention this behaviour in the docs

Re: [Python-Dev] Functions that steal references (Re: [pygame] [patch] minor memory leaks...)

2009-06-16 Thread Greg Ewing
Christian Heimes wrote: But it is a convenient oddity nonetheless. What's convenient about it? Seems to me it's the opposite, since you can't just bail out if it fails, but have to decref the reference you thought it was going to take care of fo

Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-17 Thread Greg Ewing
and that limit needs to be documented so that people can write correct programs. This is true of both kinds of peeking, so I concede that they both break the abstraction. However I think the non-blocking peek breaks it more than the blocking one, because it also brings non-deterministic behaviour. -- G

Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-18 Thread Greg Ewing
() That's exactly why I think the blocking version should keep reading until the requested number of bytes is available (or the buffer is full or EOF occurs). In other words, the blocking version should be fully deterministic given knowledge of the buffer size. --

Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-20 Thread Greg Ewing
Lucas P Melo wrote: Am I understanding this correctly: * The blocking version would not do any raw reads. No, the blocking version would keep doing raw reads until the buffer contains enough bytes. -- Greg ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] run time error anlysis of python source code

2009-06-21 Thread Greg Ewing
e world if it failed !! Although personally, if something might cause the end of the world if it failed, I'd prefer not to attempt it in the first place !! -- Apocalypse Python !! - If you ever need to use it, you're in deep trouble... !! Greg !! __

Re: [Python-Dev] 2.6 object.__init__ & deling __new__

2009-07-15 Thread Greg Ewing
P.J. Eby wrote: In effect, 2.6 forces you to have a common known base class *other* than 'object' in order to write co-operative classes. :-( You have to do that anyway if you want to make cooperative calls to any method *other* that __init__

Re: [Python-Dev] Py_TPFLAGS_HEAPTYPE too overloaded

2009-07-26 Thread Greg Ewing
er consequences follow. -- 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] Py_TPFLAGS_HEAPTYPE too overloaded

2009-07-27 Thread Greg Ewing
ncern would be if it were somehow possible to crash the interpreter by modifying the type dict. I don't see how that could happen -- but maybe someone else on python-dev knows more about this? -- Greg ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] random number generator state

2009-08-15 Thread Greg Ewing
I can give you further details. -- 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] functools.compose to chain functions together

2009-08-16 Thread Greg Ewing
The decision on whether to include something in the stdlib needs to be based on the wider picture. In this case, it's trivial to write your own if you want it. As they say, "not every one-line function needs to be in the stdlib". -- Greg ___

Re: [Python-Dev] another Py_TPFLAGS_HEAPTYPE question

2009-08-16 Thread Greg Ewing
o anything disastrous happening. Note that by not giving instances a __dict__, they will be prevented from having arbitrary attributes set on them, which is the most noticeable distinction between built-in and user-defined types. -- Greg ___ Python-Dev ma

Re: [Python-Dev] random number generator state

2009-08-16 Thread Greg Ewing
umping-ahead. (Sorry it's in C++, I hadn't discovered Python when I wrote it.) [1] Pierre L'Ecuyer, Good Parameters and Implementations for Combined Multiple Recursive Random Number Generators, Operations Research v47 no1 Jan-Feb 1999 http://www.iro.umontreal.

Re: [Python-Dev] Problems with events in a numeric keyboard

2009-08-26 Thread Greg Ewing
Martin Zugnoni wrote: when I press the triple zero key once, I receive three events from the single zero key. I need to make a disctintion between these keys Sounds like you can't, except perhaps by detecting three '0' key events arriving at almost the same

Re: [Python-Dev] default of returning None hurts performance?

2009-08-31 Thread Greg Ewing
would introduce would be a good idea. -- 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] default of returning None hurts performance?

2009-09-01 Thread Greg Ewing
nd changing it would break a lot of code for no good 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] [OT] implicit return values

2009-09-01 Thread Greg Ewing
-- the BDFL has rejected similar suggestions on previous occasions.) -- 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] Whether to call Py_Finalize when exiting from the child process of a fork from a spawned thread

2009-09-01 Thread Greg Ewing
not* to be. Maybe we need a flag when registering an atexit handler to indicate whether it should be kept across forks? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.

Re: [Python-Dev] why different between staticmethod and classmethod on non-callable object?

2009-09-01 Thread Greg Ewing
able -- if it's empty, there's no way that calling the object could ever succeed, so you might as well fail early. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mai

Re: [Python-Dev] why different between staticmethod and classmethod on non-callable object?

2009-09-01 Thread Greg Ewing
Benjamin Peterson wrote: It depends on whether you're keeping the "callable" object around or not. Somebody could add a __call__ method later. Good point. Removing the check sounds like the right thing to do, then. -- Greg ___ Pyt

Re: [Python-Dev] [OT] implicit return values

2009-09-03 Thread Greg Ewing
Xavier Morel wrote: Methods yes (and that's one of the few Smalltalk design "features" I consider truly dumb, considering it has message cascading) Cascading is something different -- it's for sending multiple messages to the *same* receiver. It's not du

Re: [Python-Dev] Numeric alignment issue with PEP 3101

2009-09-07 Thread Greg Ewing
fault for %-formatting is actually right alignment for *all* types, including 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/pytho

Re: [Python-Dev] PEP 3144 review.

2009-09-16 Thread Greg Ewing
dress in that network. If that's true, then you *can't* calculate the network address from a host address and a netmask -- there isn't enough information. Furthermore, an IPNetwork object needs to be able to represent a network address whose address part contains bits that aren

Re: [Python-Dev] PEP 3144 review.

2009-09-16 Thread Greg Ewing
an (IPNetwork, IPAddress) pair, or attaching a 'network' attribute to an IPAddress, or some other solution when the need arises. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] PEP 3144 review.

2009-09-16 Thread Greg Ewing
(ip_number) Address(ip_number, network = ) Address(ip_number, mask = ) # constructs and attaches a suitably-masked Network instance We could also have some_network[n] return an Address referring back to the network object it was obtained from

Re: [Python-Dev] PEP 3144 review.

2009-09-16 Thread Greg Ewing
o address on its own has, but if it's considered useful enough to have an attribute for it, calling it something like 'base_address' would be less confusing. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/ma

Re: [Python-Dev] PEP 3144 review.

2009-09-17 Thread Greg Ewing
Peter Moody wrote: the address with all of the hosts bits masked to zero is most commonly referred to as the network address. Then call the attribute 'network_address', not just 'network'. -- Greg ___ Python-Dev mailing list P

Re: [Python-Dev] PEP 3144 review.

2009-09-18 Thread Greg Ewing
they do in v4, then there's no need to iterate over anything -- it's just a matter of turning on all the low bits of the address. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-de

Re: [Python-Dev] POSIX [Fuzziness in io module specs]

2009-09-19 Thread Greg Ewing
en working cross-platform. What we could do with is better platform-independent ways of distinguishing particular error conditions, such as file not found, out of space, etc., either using subclasses of IOError or mapping error codes to a set of platform-independent ones

Re: [Python-Dev] POSIX [Fuzziness in io module specs]

2009-09-19 Thread Greg Ewing
code, e.g. try: something_with_file(path) except EnvironmentError, e: report_error("Couldn't do that with %s: %s" % (path, e)) This is a pattern I use a lot, and it seems to work pretty well. -- Greg ___ Python-Dev mailing

Re: [Python-Dev] Fuzziness in io module specs

2009-09-19 Thread Greg Ewing
ented it and left it that way. Then the POSIX committee came along and incorporated it into the standard so as to be compatible with existing practice. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailma

Re: [Python-Dev] Fuzziness in io module specs

2009-09-20 Thread Greg Ewing
term, that had better be replaced asap. There's something to be said for that, but there's also something to be said for following established conventions, and there's a long-established precedent from the C library for having a function called tr

Re: [Python-Dev] operator precedence of __eq__, __ne__, etc, if both object have implementations

2009-09-22 Thread Greg Ewing
d before x.__op__(y). How does this work at the C typeslot level, where there are no __rop__ methods? -- 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] operator precedence of __eq__, __ne__, etc, if both object have implementations

2009-09-23 Thread Greg Ewing
ction heading in the docs. -- 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] operator precedence of __eq__, __ne__, etc, if both object have implementations

2009-09-23 Thread Greg Ewing
an __rop__ method distinct from the __op__ method? -- 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] unsubscriptable vs object does not support indexing

2009-09-23 Thread Greg Ewing
ographical term that is at best a metaphor when applied to a language written linearly. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/pyt

Re: [Python-Dev] IO module precisions and exception hierarchy

2009-09-27 Thread Greg Ewing
ror (filepath max lengths, or "? / : " characters in a windows file name...) This might be a bit too precise. Unix just has EINVAL, which covers any kind of invalid parameter, not just file names. -- Greg ___ Python-Dev mailing list Python-Dev@py

Re: [Python-Dev] PEP 3144 review.

2009-09-27 Thread Greg Ewing
t "strict=False" covers, I think I'd rather have a separate constructor function or method for this, rather than a somewhat cryptically named boolean parameter. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.o

Re: [Python-Dev] IO module precisions and exception hierarchy

2009-09-27 Thread Greg Ewing
e improved, but that's an orthogonal issue. -- 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 3144 review.

2009-09-27 Thread Greg Ewing
ly said I was not going to do with ipaddr. Would you be kind enough to explain exactly what use case you have for retaining this information? Apologies if you've done so before -- I've been trying to follow this discussion, but that point doesn't seem to have co

Re: [Python-Dev] IO module precisions and exception hierarchy

2009-09-28 Thread Greg Ewing
. -- 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] IO module precisions and exception hierarchy

2009-09-28 Thread Greg Ewing
ay of sorting them out, then obviously you can represent them using different exceptions if you want. -- 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] PEP 3144 review.

2009-09-28 Thread Greg Ewing
is that it would have to be useful a *lot* of the time, not just "sometimes", to be worth having it on every IPNetwork object. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubs

Re: [Python-Dev] [OT] Denormalized fractions [was Re: PEP 3144 review.]

2009-09-29 Thread Greg Ewing
Steven D'Aprano wrote: there's a mathematical operator called the mediant: mediant(a/b, c/d) = (a+c)/(b+d) That's a function of four arguments, not two! -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.pyt

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-29 Thread Greg Ewing
x27;s an art to coming up with an API that makes simple things easy and other things possible. I'm not convinced that argparse represents a subsantial enough advancement in that art to justify replacing optparse with it in the stdlib, and thereby forcing everyone to learn a similar-but-dif

Re: [Python-Dev] PEP 3144 review.

2009-09-29 Thread Greg Ewing
;t just a "network", it's more like "network plus the address of its interface". So some people think that using the name "IPNetwork" for this object is confusing. -- Greg ___ Python-Dev mailing list Python-Dev@python.org ht

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-29 Thread Greg Ewing
Paul Moore wrote: I'd rather argparse (or any library function) didn't call sys.exit on my behalf - it should raise an exception. Actually, sys.exit() *does* raise an exception (i.e. SystemExit) that you can catch if you want. -- Greg ___

Re: [Python-Dev] transitioning from % to {} formatting

2009-10-06 Thread Greg Ewing
arise, of course, but hopefully they will be fairly rare, and raising an exception would point out the problem and allow it to be fixed. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] PEP 3144 review.

2009-10-06 Thread Greg Ewing
is is overly burdensome in my mind. Seems to me what you want isn't so much an IPNetwork that can optionally have an address, as an IPAddress that can optionally have a mask, and methods for deriving those other things from it. -- Greg ___ Python-D

Re: [Python-Dev] transitioning from % to {} formatting

2009-10-06 Thread Greg Ewing
und, there will still be heaps of code around that uses %-formatting, so it won't be possible to remove it in 4.x either. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Uns

Re: [Python-Dev] Announcing PEP 3136

2009-10-06 Thread Greg Ewing
just special cases of 2, when you include the empty-list case. So you're making it more complicated in your mind than it really is. Any chances of cleaning this one up for python 4? I doubt that many other people will see anything here that needs cle

Re: [Python-Dev] PEP 3144 review.

2009-10-06 Thread Greg Ewing
ased on a conceptually sound design. Peter is of course within his rights not to change his module in this way. But this just means that ipaddr is not the right module to adopt, and we should design another one and give it a different name. -- Greg ___

Re: [Python-Dev] PEP about sys.implementation and implementation specific user site directory

2009-10-09 Thread Greg Ewing
tion language. Maybe it stands for "classic python". :-) -- 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] Top-posting on this list

2009-10-10 Thread Greg Ewing
The only possible benefit is to allow latecomers to catch up on the thread without having to consult any archives. But I've never seen any complaints that people who *do* quote responsibly are making this hard, so I can only conclude that it's not a significa

Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-11-02 Thread Greg Ewing
sound any more useful. What would it gain you? Why not just iterate over the set? Or make a copy and repeatedly pop() it? I completely fail to see a use case for this. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/m

Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-11-03 Thread Greg Ewing
dom index until it points to a non-empty slot. But that's hardly O(1). -- 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] Retrieve an arbitrary element from a set withoutremoving it

2009-11-03 Thread Greg Ewing
Steven D'Aprano wrote: I don't know how expensive it is to create a set iterator, Not expensive enough to justify burdening the set type with extra functionality that will be extremely rarely used. -- Greg ___ Python-Dev mailing list

Re: [Python-Dev] PEP 3003 - Python Language Moratorium

2009-11-08 Thread Greg Ewing
ly *does* want to discourage such discussions. -- 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] decimal.py: == and != comparisons involving NaNs

2009-11-09 Thread Greg Ewing
Antoine Pitrou wrote: The problem is when searching for /another/ object which hashes the same as Decimal("NaN"). Maybe decimal NaNs should be unhashable, so that you can't put them in a dictionary in the first place. -- Greg ___ Pyt

Re: [Python-Dev] Replacing IDLE

2009-11-10 Thread Greg Ewing
nding their way around text editors and command shells. So, I'd say that, like democracy, it's not very good, but it's better than any of the alternatives. :-) -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.o

Re: [Python-Dev] Replacing IDLE

2009-11-10 Thread Greg Ewing
a practically usable state and it ever gets included in the core distribution, then it might be a viable basis for a modernised version of IDLE. That's probably a fairly long way off, though. -- Greg ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] standard libraries don't behave like standard 'libraries'

2009-11-13 Thread Greg Ewing
h ones I actually *do* use so I could mantain that list, something I don't have to think about at the moment. It mightn't be so bad if the whole stdlib were a *single* package, but I don't see much advantage in that. -- Greg __

[Python-Dev] new unbounded memory leak in exception handling?

2009-11-17 Thread Greg Hewgill
is is a regression error, since Python 2.x does not exhibit the same behaviour. Can anybody confirm this? Greg Hewgill http://hewgill.com ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] new unbounded memory leak in exception handling?

2009-11-17 Thread Greg Hewgill
ion value in a python2/3 portable way a = sys.exc_info()[1] a.__traceback__ = None I have added a doc bug issue for this: http://bugs.python.org/issue7340 Greg Hewgill http://hewgill.com ___ Python-Dev mailing list Python-Dev@p

Re: [Python-Dev] recursive closures - reference cycle

2009-12-08 Thread Greg Ewing
You could use a class: class factorial(): def fac(self, n): if n == 0: return 1 else: return n * self.fac(n - 1) def __call__(self, n): return self.fac(n) factorial = factorial() print factorial(5) -- Greg

Re: [Python-Dev] recursive closures - reference cycle

2009-12-09 Thread Greg Ewing
abouts in the docs to put information about this, however. It really relates to a certain pattern of using language features rather than to any particular feature. Maybe there should be a section devoted to avoidance of reference cycles where all of these known pitfalls can

Re: [Python-Dev] Add UTC to 2.7 (PyCon sprint idea)

2010-02-16 Thread Greg Ewing
etime objects are naive unless you explicitly specify a timezone. -- 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%4

Re: [Python-Dev] Proposal for virtualenv functionality in Python

2010-02-20 Thread Greg Ewing
27;re extremely dangerous, because the GUI side of win2k doesn't know about them. It thinks that a symlink to a folder is a real folder, and if you delete it, you end up deleting the contents of the folder that the symlink points to. So if you use them, you need to keep

Re: [Python-Dev] Another version of Python

2010-02-24 Thread Greg Ewing
Reminiscent of INTERCAL, where you had to say PLEASE at regular but not too frequent intervals, or the compiler would accuse you of being either too impolite or too smarmy. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http

Re: [Python-Dev] __file__

2010-02-25 Thread Greg Ewing
ite a custom import hook. What I don't like this idea at all. I object to being forced to jump through an obscure hoop to do something that's been totally straightforward until now. -- Greg ___ Python-Dev mailing list Python-Dev@

Re: [Python-Dev] __file__

2010-02-25 Thread Greg Ewing
Michael Foord wrote: I thought we agreed at the language summit that if a .pyc was in the place of the source file it *could* be imported from - making pyc only distributions possible. Ah, that's okay, then. Sorry about the panic! --

Re: [Python-Dev] PEP 3188: Implementation Questions

2010-02-26 Thread Greg Ewing
Meador Inge wrote: 3. Using Decimal keeps the desired precision, Well, sort of, but then you end up doing arithmetic in decimal instead of binary, which could give different results. Maybe the solution is to give ctypes long double objects the ability to do arithmetic? -- Greg

Re: [Python-Dev] __file__

2010-02-27 Thread Greg Ewing
ed to get in, but it makes it hard for them to argue in court that they wandered in accidentally. Also it may make it easier to get the idea of using Python past PHBs. That seems to me like a good reason for keeping the feature. -- Greg ___ Python-Dev mai

Re: [Python-Dev] __file__

2010-02-27 Thread Greg Ewing
amines the contents of the file to figure out what it is, in order to support running .pyc files from the command line. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.

Re: [Python-Dev] PEP 3188: Implementation Questions

2010-02-27 Thread Greg Ewing
Decimal type so that it gives identical results to that of any IEEE binary floating point type, including rounding behaviour, denormalisation, etc. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-

Re: [Python-Dev] __file__

2010-02-27 Thread Greg Ewing
tory would only have to be done once per package and the result remembered, so it would add very little overhead. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.

Re: [Python-Dev] __file__

2010-02-28 Thread Greg Ewing
lly a binary file. So on balance I think it's a bit too kooky for my taste. -- 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] __file__

2010-02-28 Thread Greg Ewing
ake significant time compared to loading the module? Once you've looked for one file in a given directory, looking for another one in the same directory ought to be quite fast, since all the relevant directory blocks will be in the filesystem cache. -- Greg _

Re: [Python-Dev] __file__

2010-02-28 Thread Greg Ewing
calls are negligible once the cache is warmed up. -- 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] __file__

2010-02-28 Thread Greg Ewing
llow you to apply that action to 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] __file__

2010-03-01 Thread Greg Ewing
sourceful program. Such a situation might arise if you have an application with a scripting interface that is used by importing stuff from the application's internal libraries. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.pyt

Re: [Python-Dev] Python and Windows 2000

2010-03-02 Thread Greg Ewing
to be free of Microsoft DRM crap, and I'd be unhappy if I were forced to downgrade to a later version just so I could use Py3 on it. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscr

Re: [Python-Dev] __file__ and bytecode-only

2010-03-03 Thread Greg Ewing
had much experience building installers using distutils, so I'm not sure how much of a problem that would be.) -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.o

Re: [Python-Dev] __file__ and bytecode-only

2010-03-03 Thread Greg Ewing
Glenn Linderman wrote: In this scenario, the .pyc files would still live in __pycache__ ? Complete with the foo..pyc naming ? It might be neater to have a separate cache directory for each bytecode version, named __cache.__ or some such. -- Greg

Re: [Python-Dev] __file__ and bytecode-only

2010-03-03 Thread Greg Ewing
Glyph Lefkowitz wrote: if we're going to have it be something.something-else, can we please make sure that .something-else is a common extension that means "python bytecode cache"? Maybe something like __bytecode-__.pycache ? -- Greg ___

<    4   5   6   7   8   9   10   11   12   13   >