Re: [Python-Dev] lnotab and the AST optimizer

2008-07-24 Thread Greg Ewing
rs. I can't imagine that the size of an uncompressed lnotab would be a problem in this day and age. If ordering is an issue, generate it internally as a dict and convert it to a sorted list on output. -- Greg ___ Python-Dev mailing list Python-Dev@

Re: [Python-Dev] Infix operators

2008-07-24 Thread Greg Ewing
f you add a matrix and a plain numpy array, what type should the result be? If plain numpy arrays can be used directly as matrices, that problem goes away. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo

Re: [Python-Dev] Infix operators

2008-07-24 Thread Greg Ewing
. What's more, it doesn't address the real problem at hand, which is providing a notation for matrix multiplication that is concise enough to be used *very* frequently -- like multiple times in every line of code that manipulates matrices. -- Greg

Re: [Python-Dev] Infix operators

2008-07-24 Thread Greg Ewing
alk about wanting to using numpy.array. Yes -- what's wrong with that? How does this not make it clear that there is not a case of TOOWTDI? I think there *is* one obvious way of representing a matrix, or any 2D array, using built-in Python types, or rather two ways -- a list

Re: [Python-Dev] Infix operators

2008-07-24 Thread Greg Ewing
s well. The trouble is that, for the people who badly want a matrix multiplication operator, 3 characters is far too long! -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: ht

Re: [Python-Dev] Matrix product

2008-07-25 Thread Greg Ewing
notation was added purely for use by Numeric and its successors, and nothing in core Python attaches any meaning to it. How do the PEPs work? Someone writes a PEP. People talk about it. Eventually, Guido either accepts it or rejects it (although in some cases it is an infinitely long time be

Re: [Python-Dev] Matrix product

2008-07-27 Thread Greg Ewing
(e, f) -- 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] Matrix product

2008-07-29 Thread Greg Ewing
be totally outlandish to propose A**B for matrix multiplication? I can't think of what "matrix exponentiation" would mean... But ** has the same problem -- it already represents an elementwise operation on numpy arrays. -- Greg ___ Python-De

Re: [Python-Dev] Matrix product

2008-07-29 Thread Greg Ewing
o use heavily. In MATLAB, the elementwise operations are probably used fairly infrequently. But numpy arrays are often used to vectorise what are otherwise scalar operations, in which case elementwise operations are used almost exclusively. -- Greg ___ P

Re: [Python-Dev] Matrix product

2008-07-29 Thread Greg Ewing
has some unicode symbol for it (I suppose that would be one desperate possibility). I've been carefully refraining from suggesting that. Although now that unicode is allowed in identifiers, it's not *quite* as heretical as it used to be

Re: [Python-Dev] Memory Error while reading large file

2008-07-31 Thread Greg Ewing
Martin v. Löwis wrote: (maybe the use of the question mark is more typical in German than in English; my stomach turns around when I read a question that ends with a full stop) No, it's required in English, too. -- Greg ___ Python-Dev ma

[Python-Dev] Base-95 (Re: Base-96)

2008-08-02 Thread Greg Ewing
oding routines I wrote. -- 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] April 1st jokes

2008-08-03 Thread Greg Ewing
g how to reduce the number of ways of copying a list, but Google doesn't seem to want to find it. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailma

Re: [Python-Dev] Py_CLEAR and assigning values

2008-08-05 Thread Greg Ewing
x.a = Foo() >>> del x.a __del__ Exception exceptions.AttributeError: "'Foo' object has no attribute 'a'" in > ignored -- 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] subprocess insufficiently platform-independent?

2008-08-25 Thread Greg Ewing
ementation should do its own %PATHEXT% lookup when the shell is not being used. -- 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/arch

Re: [Python-Dev] Things to Know About Super

2008-08-27 Thread Greg Ewing
example of this where multiple inheritance is actually used? A non-contrived example or two would be a good thing to have in tutorials etc. where super() is discussed. It would help to convey the kinds of situations in which use of super() is and is not appropriate. -- Greg

Re: [Python-Dev] Things to Know About Super

2008-08-27 Thread Greg Ewing
M.-A. Lemburg wrote: The typical use is in mixin classes that can be used to add functionality to base classes... But this is just another waffly made-up example. I'm talking about real-life use cases from actual code that's in use

Re: [Python-Dev] confusing exec error message in 3.0

2008-08-28 Thread Greg Ewing
he source file for a module, regardless of whether it was loaded from a .py, .pyc or .pyo. Maybe there should be a __source__ attribute for that? Or is os.path.splitext(M.__file__)[0] + ".py" considered good enough for that? -- Greg ___ Pyth

Re: [Python-Dev] Further PEP 8 compliance issues in threading and multiprocessing

2008-09-01 Thread Greg Ewing
under a lower-case name, that can be replaced with a factory function later. In this case, the thing to decide is whether Event will always be a direct class instantiation. If so, rename _Event to Event and expose it directly. If not, rename Event to event. -- Greg

Re: [Python-Dev] Further PEP 8 compliance issues in threading and multiprocessing

2008-09-02 Thread Greg Ewing
could be categorized. Is this particular one so important that it warrants a naming convention? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailma

Re: [Python-Dev] Further PEP 8 compliance issues in threading and multiprocessing

2008-09-02 Thread Greg Ewing
not* being classes, and that seems rather unlikely). -- 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] fileobj.read(float): warning or error?

2008-09-02 Thread Greg Ewing
oss a situation where allowing read(0) to occur would have simplified the code. In the usual keep-reading-until-we've-got-the- required-number-of-bytes scenario, you're checking for 0 bytes left to read in order to tell when to stop. -- Greg __

Re: [Python-Dev] fileobj.read(float): warning or error?

2008-09-02 Thread Greg Ewing
s as an EOF condition. However, with some devices it's possible for what counts as EOF to happen more than once, e.g. ttys. -- 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] Add python.exe to PATH environment variable

2008-09-02 Thread Greg Ewing
do on Unix? -- 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] Add python.exe to PATH environment variable

2008-09-02 Thread Greg Ewing
ption. I'm not sure about having it disabled by default, though, since naive users are the ones that stand to benefit most from it, yet they're least likely to know that they need to turn it on. -- Greg ___ Python-Dev mailing list Python-De

Re: [Python-Dev] Add python.exe to PATH environment variable

2008-09-03 Thread Greg Ewing
Eric Smith wrote: But I agree that managing a single batch file is easier than dealing with the PATH variable, and has fewer side effects (finding DLL's, etc.). This would only be possible for an administrator installation, though, not a per-user one. --

Re: [Python-Dev] Add python.exe to PATH environment variable

2008-09-03 Thread Greg Ewing
uot;python" refer to the most recently installed version, at least for 2.x, and it's not considered a problem there. In the case of 3.0, didn't we decide not to do that? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.py

Re: [Python-Dev] Add python.exe to PATH environment variable

2008-09-03 Thread Greg Ewing
t file. Instead of a bat file, maybe generate a small exe that does the job? -- 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] bsddb alternative (was Re: [issue3769] Deprecate bsddb for removal in 3.0)

2008-09-05 Thread Greg Ewing
stribution, just the stdlib modules the app actually uses. So it's not as bad as including a whole Python installation for every app. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe

Re: [Python-Dev] Add python.exe to PATH environment variable

2008-09-08 Thread Greg Ewing
he program, get to see the output before the window disappears, 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/arch

Re: [Python-Dev] Filename as byte string in python 2.6 or 3.0?

2008-09-29 Thread Greg Ewing
broken or legacy? -- 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-3000] New proposition for Python3 bytes filename issue

2008-09-30 Thread Greg Ewing
ay on some unsuspecting user that doesn't have the inclination to go diving into the code to fix it. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman

Re: [Python-Dev] if-syntax for regular for-loops

2008-10-03 Thread Greg Ewing
more than newlines -- it saves the code to set up and append to a list. This is a substantial improvement when this code would otherwise swamp the essentials of what's being done. This doesn't apply to a plain for-loop that's not building a

Re: [Python-Dev] if-syntax for regular for-loops

2008-10-05 Thread Greg Ewing
Nick Coghlan wrote: it was just odd to notice that the Py3k interpreter would quite happily execute the example code in my postscript when I had really only intended to write it as pseudo-code with sections missing. Well, they do say that Python is executable pseudocode. :-) -- Greg

Re: [Python-Dev] __getattr__ and new style classes

2008-10-08 Thread Greg Ewing
Kristján Valur Jónsson wrote: Using new style classes to provide attribute-like access using __getattr__ is considerably slower than old style classes Do you really need __getattr__, or could you use properties instead? -- Greg ___ Python-Dev

Re: [Python-Dev] __getattr__ and new style classes

2008-10-09 Thread Greg Ewing
ed by Python 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] __getattr__ and new style classes

2008-10-09 Thread Greg Ewing
alue separation gone away completely, or is it still there at the C level? -- 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] [pygtk] Application name is '-c'

2008-10-14 Thread Greg Ewing
s a bug or not. It's not clear what the app name *should* be when you use -c. What do the python-dev folks think? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.py

Re: [Python-Dev] [ANN] VPython 0.1

2008-10-23 Thread Greg Ewing
ses of the switched-to code as the virtual instruction opcodes, so the dispatch is just an indirect jump. I'm having trouble seeing how that would help with branch prediction, though -- seems to me it should make it worse if anything, since the CPU has no idea where an indirect jump is going

Re: [Python-Dev] [ANN] VPython 0.1

2008-10-23 Thread Greg Ewing
hings like attribute lookups and function calls, rather than fiddling with integers in local variables. -- 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] [ANN] VPython 0.1

2008-10-23 Thread Greg Ewing
Guido van Rossum wrote: there already is something else called VPython Perhaps it could be called Fython (Python with a Forth-like VM) or Thython (threaded-code Python). -- Greg ___ Python-Dev mailing list Python-Dev@python.org http

Re: [Python-Dev] [ANN] VPython 0.1

2008-10-23 Thread Greg Ewing
with machine generated code would be a step away from that. -- 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

Re: [Python-Dev] [ANN] VPython 0.1

2008-10-24 Thread Greg Ewing
er for the reader to learn about. I'm not saying this is a bad enough problem to stop it being done, just that it's something to consider that isn't necessarily on the positive side. -- Greg ___ Python-Dev mailing list Python-Dev@python

Re: [Python-Dev] [ANN] VPython 0.1

2008-10-25 Thread Greg Ewing
to be rewritten in a completely different way. Just changing the VM isn't going to make a difference to that. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.pytho

Re: [Python-Dev] [ANN] VPython 0.1

2008-10-26 Thread Greg Ewing
ut my guess is that it would help about the same amount as it would help non-Stackless Python, i.e. there's not much about stacklessness per se that makes it particularly beneficial to have a generated VM. -- Greg ___ Python-Dev mailing list Python-Dev@

Re: [Python-Dev] Fwd: Removal of GIL through refcounting removal.

2008-11-02 Thread Greg Ewing
get pauses occurring at random times. Sometimes in games I've found that I had to disable cyclic GC in order to get smooth frame rates. With no refcounting I wouldn't have the option of doing that. I'd be disappointed if that meant I could no longer use Python for these

Re: [Python-Dev] Looking for VCS usage scenarios

2008-11-04 Thread Greg Ewing
n brain. I have enough trouble keeping the intricacies of hg in my head from one session to the next. I wouldn't relish the idea of having to use another similar-but-not-quite-the-same tool at the same time. -- Greg ___ Python-Dev mailing list Python

Re: [Python-Dev] Optionally using GMP to implement long if available

2008-11-04 Thread Greg Ewing
Python distribution for Windows wouldn't be compiled that way, so it wouldn't have any GMP-related code in its dll. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscr

Re: [Python-Dev] Optionally using GMP to implement long if available

2008-11-04 Thread Greg Ewing
;re just shipping an unmodified GMP library. -- 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] Using Cython for standard library?

2008-11-04 Thread Greg Ewing
them. Considering that Pyrex favours efficiency over compatibility with Python where there's a conflict, it would perhaps be more appropriate for standard library use, if such a thing were to be considered at all -- which doesn't seem very likely in the near f

Re: [Python-Dev] Looking for VCS usage scenarios

2008-11-04 Thread Greg Ewing
of course, to make one of the existing VCSes written in C available as an extension module. :-) -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/opti

Re: [Python-Dev] Optionally using GMP to implement long if available

2008-11-09 Thread Greg Ewing
int32 * my_other_uint32 and the other using my_uint64 * my_other_uint64, and seeing whether one is faster than the other? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.pytho

Re: [Python-Dev] n.numbits: method or property?

2008-11-12 Thread Greg Ewing
Terry Reedy wrote: Math is pretty much float, not int functions. Also, it's supposed to be confining itself to wrapping the C math library. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/p

Re: [Python-Dev] n.numbits: method or property?

2008-11-12 Thread Greg Ewing
Antoine Pitrou wrote: As for numbits, I think it should be a method It feels more method-like to me too, because it's something derived from the int's value rather than an independent piece of information. -- Greg ___ Python-Dev mailing l

Re: [Python-Dev] n.numbits: method or property?

2008-11-12 Thread Greg Ewing
Aahz wrote: What do you call Decimal? ;-) If you're working with decimal numbers, you're more likely to want a numdigits() method. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/

Re: [Python-Dev] Python for windows.

2008-11-27 Thread Greg Ewing
d into the openssl extension module instead? It's already assumed that Python extension modules are linked against the correct version of the runtime for the python.exe being used. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://

Re: [Python-Dev] Python for windows.

2008-11-27 Thread Greg Ewing
Mark Hammond wrote: The only conflict I see here is the requirement to install into "\Program Files" Doesn't that just mean that if an OEM decides to preinstall it, they need to put it in Program Files? They're at liberty

Re: [Python-Dev] __import__ problems

2008-11-28 Thread Greg Ewing
any replacement __import__ functions will be required to conform to the new interface, and existing ones will no longer be valid. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-07 Thread Greg Ewing
Nick Coghlan wrote: For binary wrappers around the Windows Unicode APIs, I was thinking specifically of using UTF-8, since that should be able to encode anything the Unicode APIs can handle. Why shouldn't the binary interface just expose the raw utf16 as bytes? --

Re: [Python-Dev] Allocation of shape and strides fields in Py_buffer

2008-12-08 Thread Greg Ewing
ble-sized shape and strides arrays, it has to manage the memory for them somehow. -- 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

Re: [Python-Dev] Allocation of shape and strides fields in Py_buffer

2008-12-09 Thread Greg Ewing
tride arrays for its particular view of the underlying object. -- 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] Allocation of shape and strides fields in Py_buffer

2008-12-09 Thread Greg Ewing
long as they're needed. -- 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] Allocation of shape and strides fields in Py_buffer

2008-12-09 Thread Greg Ewing
them when releasebuffer is called." Even allowing this seems rather dubious to me. I suppose there's no serious danger as long as the block of memory ultimately holding the data doesn't move or change size, but changing the shape could confuse a buffer user that's ite

Re: [Python-Dev] Allocation of shape and strides fields in Py_buffer

2008-12-09 Thread Greg Ewing
e basic idea is sound: that Py_buffer objects are ephemeral, to be obtained when needed and not kept for any longer than necessary. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] Forking and pipes

2008-12-09 Thread Greg Ewing
n file object before forking or (b) use os.write() directly on the fd to avoid the buffering. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/option

Re: [Python-Dev] Allocation of shape and strides fields in Py_buffer

2008-12-10 Thread Greg Ewing
alid slice could still fail. In any case, I think it should be possible to implement either version without the memoryview having to own more than one Py_buffer and one set of shape/strides at a time. Slicing the memoryview creates another memoryview with its own Py_buffer and shape/strides. -- Gre

Re: [Python-Dev] Allocation of shape and strides fields in Py_buffer

2008-12-10 Thread Greg Ewing
uffer structures. To be precise, the important thing is for the memoryview to allocate its own shape and strides. It's not strictly necessary to keep them internally in a Py_buffer struct, although that may be a convenient way to do it. -- Greg ___

Re: [Python-Dev] Allocation of shape and strides fields in Py_buffer

2008-12-10 Thread Greg Ewing
e you another set of shape/strides info describing the slice. It seems sensible to put the effort into doing this correctly once, rather than leave everyone implementing a memoryview-like object to come up with their own half-working and/or broken implementation. --

Re: [Python-Dev] Allocation of shape and strides fields in Py_buffer

2008-12-10 Thread Greg Ewing
some utilities for doing things like this could be useful, as I mentioned in another post. -- 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] Calling the GC less often when there are lots of long-lived objects

2008-12-16 Thread Greg Ewing
Antoine Pitrou wrote: I've proposed a patch which basically implements Martin's suggestion in http://mail.python.org/pipermail/python-dev/2008-June/080579.html Is anybody opposed to the principle of this proposal? Sounds okay to me

Re: [Python-Dev] The endless GIL debate: why not remove thread support instead?

2008-12-17 Thread Greg Ewing
Nick Coghlan wrote: Actually, I believe 3.0 already took a big step towards allowing this by changing the way modules are initialised. It's a step, but I wouldn't call it a big one. There are many other problems to be solved before fully independent interpreters are possible

Re: [Python-Dev] The endless GIL debate: why not remove thread support instead?

2008-12-18 Thread Greg Ewing
reters. In the Apache case, it's probably more about providing virtual Python environments than free-threading between interpreters. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Uns

Re: [Python-Dev] Should there be a source-code checksum in module objects?

2009-02-02 Thread Greg Ewing
necessarily a *convenient* way... -- 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] Missing operator.call

2009-02-05 Thread Greg Ewing
e were used. Maybe apply() could be reinstated and put into the operator module? -- 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] Missing operator.call

2009-02-05 Thread Greg Ewing
using generators as coroutines more convenient, and I came up with the idea of a new statement call expr which would be equivalent to for x in expr: yield x This happens to be the same as what "yield *" would do, so it kind of unifies the two i

Re: [Python-Dev] Missing operator.call

2009-02-06 Thread Greg Ewing
chunk of code from a generator that contains a 'yield' and put it into another function, and then call it in a way that resembles an ordinary function call as closely as possible. Maybe 'call' isn't the best word for that, bu

Re: [Python-Dev] Missing operator.call

2009-02-06 Thread Greg Ewing
Stephen J. Turnbull wrote: Greg Ewing writes: > The fact that yielding is going on is not of > interest in that situation But doesn't "yield" in the sense of "yield the right of way" mean exactly that? I've no problem with using 'yield' when a

Re: [Python-Dev] cpython (2.7): note Ellipsis syntax

2011-07-30 Thread Greg Ewing
Benjamin Peterson wrote: why would you use Ellipsis outside of slices? I could imagine someone wanting to use it as part of a function API. For example, print(a, b, c, ...) would have been a nice way to tell print() not to put a newline on the end. -- Greg

Re: [Python-Dev] GIL removal question

2011-08-12 Thread Greg Ewing
Sturla Molden wrote: With one interpreter per thread, and a malloc that does not let threads share memory pages (one heap per thread), Python could do the same. Wouldn't that be more or less equivalent to running each thread in a separate process? --

Re: [Python-Dev] PEP 393 Summer of Code Project

2011-08-25 Thread Greg Ewing
f the code-unit level is hidden from the programmer? -- 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 393 Summer of Code Project

2011-08-26 Thread Greg Ewing
, but that's easily defensible as a tradeoff to conform to underlying runtime semantics. I would only agree as long as it wasn't too much worse than O(1). O(log n) might be all right, but O(n) would be unacceptable, I think. -- Greg ___ Python-D

Re: [Python-Dev] PEP 393 Summer of Code Project

2011-08-26 Thread Greg Ewing
be no need to use surrogates in the first place. -- 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] Should we move to replace re with regex?

2011-08-27 Thread Greg Ewing
this also. -- 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] LZMA compression support in 3.3

2011-08-28 Thread Greg Ewing
tions perpetually in catch-up mode. My suggestion on how to address this would be something akin to Pyrex or Cython. I gather that there has been some work recently on adding different back-ends to Cython to generate code for different Python imple

Re: [Python-Dev] Ctypes and the stdlib (was Re: LZMA compression support in 3.3)

2011-08-29 Thread Greg Ewing
l the macros, interprets the struct declarations, etc. All you need to do when writing the .pyx file is follow the same API that you would if you were writing C code to use the library. -- Greg ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Ctypes and the stdlib (was Re: LZMA compression support in 3.3)

2011-08-29 Thread Greg Ewing
Guido van Rossum wrote: On Mon, Aug 29, 2011 at 2:17 PM, Greg Ewing wrote: All you need to do when writing the .pyx file is follow the same API that you would if you were writing C code to use the library. Interesting. Then how does Pyrex/Cython typecheck your code at compile time? You

Re: [Python-Dev] Python 3 optimizations continued...

2011-08-29 Thread Greg Ewing
ng to perform heroic optimisations. -- 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 393 Summer of Code Project

2011-09-01 Thread Greg Ewing
in all-caps, and some of them have accents: http://www.happymall.com/france/paris_street_signs.htm -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman

Re: [Python-Dev] PEP 393 Summer of Code Project

2011-09-01 Thread Greg Ewing
nglish too -- occasionally you see words like "cooperation" spelled with a diaresis over the second "o". But these days it's more common to use a hyphen, or not bother at all. Everyone knows how it's pronounced. -- Greg ___ Python-Dev

Re: [Python-Dev] PEP 393 Summer of Code Project

2011-09-01 Thread Greg Ewing
diaeresis on its side: co:operate -- 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 393 Summer of Code Project

2011-09-01 Thread Greg Ewing
Antoine Pitrou wrote: I don't think some American souvenir shop is a good reference, though :) (for example, there's no Paris street named "château de Versailles") Hmmm, I'd assumed they were reproductions of actual street signs found in Paris, bu

Re: [Python-Dev] PEP 393 Summer of Code Project

2011-09-02 Thread Greg Ewing
a lot more often than we hear them spoken. Why shouldn't we change the pronunciation to match the spelling rather than the other way around? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Uns

Re: [Python-Dev] [Python-checkins] cpython (3.2): Fix PyUnicode_AsWideCharString() doc: size doesn't contain the null character

2011-09-06 Thread Greg Ewing
er" as opposed to "empty string" or "null pointer"). I expect it's 3 chars for consistency with all the other control character names. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman

Re: [Python-Dev] Windows 8 support

2011-09-14 Thread Greg Ewing
y to go in the future. I'm glad to hear that .NET isn't going to take over the world after all! -- 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] range objects in 3.x

2011-09-23 Thread Greg Ewing
license" for more information. >>> a = xrange(5) >>> b = xrange(5) >>> a > b True -- 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] range objects in 3.x

2011-09-26 Thread Greg Ewing
wants start/end/count I think there's nothing wrong with computing end = start + step*count. +1, that makes sense to me. And I don't like "linspace" either. Something more self explanatory such as "subdivide" or &quo

Re: [Python-Dev] range objects in 3.x

2011-09-27 Thread Greg Ewing
se it was using some special technique to maximise numerical accuracy. But from this it seems like it's just using the naive algorithm that we've already decided is not the best. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http:

Re: [Python-Dev] range objects in 3.x

2011-09-27 Thread Greg Ewing
Alexander Belopolsky wrote: ("Comb" (noun) brings up the right image, but is probably too informal and may be confused with a short for "combination.") And also with "comb filter" for those who are into signal processing. -- Greg

Re: [Python-Dev] range objects in 3.x

2011-09-27 Thread Greg Ewing
Ethan Furman wrote: If it's generic, why should it live in math? Generic? Maybe that's it: grange() It's also an English word, unfortunately one with a completely unrelated meaning. :-( -- Greg ___ Python-Dev mailing list Python

Re: [Python-Dev] range objects in 3.x

2011-09-28 Thread Greg Ewing
ctably and accurately with floats extrapolate(start, step, end) Works for any type supporting addition, not recommended for floats -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/

<    13   14   15   16   17   18   19   20   21   22   >