Re: [Python-Dev] Decimal(unicode)

2008-03-26 Thread Greg Ewing
ke a byte array containing ascii chars look like a string? Then cases like this could be handled without having to copy the data. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscri

Re: [Python-Dev] Decimal(unicode)

2008-03-27 Thread Greg Ewing
t through very well when the Python version was designed. The question now is whether to fix the API design, or leave it to become entrenched and lose all hope of ever having a fully C-coded implementation. -- Greg ___ Python-Dev mailing list Python-Dev@p

Re: [Python-Dev] Decimal(unicode)

2008-03-27 Thread Greg Ewing
Georg Brandl wrote: > As Nick said, a drop-in replacement in C isn't feasible Yes, but that appears to be so only because of some unfortunate features of the Python version's API. Seems to me it would be better to undergo a little pain now and get a well-designed C-friendly A

Re: [Python-Dev] Decimal(unicode)

2008-03-28 Thread Greg Ewing
x27;t be an object with a mapping interface for this, that stores them internally as a bit field or whatever is convenient for the C code. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev U

Re: [Python-Dev] how to easily consume just the parts of eggs that are good for you

2008-04-08 Thread Greg Ewing
with eggs the other day -- it seems that tracebacks referring to egg-resident files contain the pathname of some temporary directory that existed when the egg was being packaged, rather than the one it actually exists in at run time. -- Greg ___ Pyt

Re: [Python-Dev] how to easily consume just the parts of eggs that are good for you

2008-04-09 Thread Greg Ewing
install to install it. If I'd known that setuptools would make intrusive changes to the behaviour of my system, I would never have touched it. Is there a way of *un*installing setuptools? I'd like to put my Python back the way it used to be. -- Greg _

Re: [Python-Dev] how to easily consume just the parts of eggs that are good for you

2008-04-09 Thread Greg Ewing
. The actual path is known when the module is loaded, so it should just be a matter of storing it somewhere appropriate. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

Re: [Python-Dev] thoughts on having EOFError inherit from EnvironmentError?

2008-04-14 Thread Greg Ewing
"File could not be read/written/whatever because..." kind of message. Having EOFError get missed by that would be a nuisance. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe

Re: [Python-Dev] string representation of range in 3.0

2008-04-15 Thread Greg Ewing
ch like a list. I think that would make things more confusing for a newcomer rather than less. The way they are, at least it's obvious that they're something special. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.pyt

Re: [Python-Dev] thoughts on having EOFError inherit from EnvironmentError?

2008-04-15 Thread Greg Ewing
nt. However, thinking about it a bit more, anything that calls something that can raise EOFError should be catching it anyway, so an escaped EOFError represents a program bug. So it's probably okay. -- Greg ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] string representation of range in 3.0

2008-04-15 Thread Greg Ewing
Guido van Rossum wrote: > That's why I proposed <0, 1, ..., 9> for repr(range(10)). My worry is that this will lead a newcomer into thinking this is some kind of valid expression syntax. -- Greg ___ Python-Dev mailing list Python-Dev@p

Re: [Python-Dev] thoughts on having EOFError inherit from EnvironmentError?

2008-04-15 Thread Greg Ewing
ndard exception type if one existed at the right point in the hierarchy to catch what I want to catch, but there isn't one. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: ht

Re: [Python-Dev] thoughts on having EOFError inherit from EnvironmentError?

2008-04-16 Thread Greg Ewing
Guido van Rossum wrote: > You are unique in demanding this. Really? Nobody else wants a convenient way to distinguish program bugs from exceptions caused by external factors? -- Greg ___ Python-Dev mailing list Python-Dev@python.org h

Re: [Python-Dev] thoughts on having EOFError inherit from EnvironmentError?

2008-04-16 Thread Greg Ewing
Guido van Rossum wrote: > You are unique in demanding this. I'm not asking for anything to be changed (I've already agreed that EOFError can stay the way it is), just pointing out what I think is a legitimate use for custom EnvironmentError subclass

Re: [Python-Dev] string representation of range in 3.0

2008-04-16 Thread Greg Ewing
Brad Miller wrote: > I wouldn't include the word "object" in any of these. Everything in Python is an object, so it's just space-wasting noise. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/

Re: [Python-Dev] thoughts on having EOFError inherit from EnvironmentError?

2008-04-18 Thread Greg Ewing
s designed for, and I'm perplexed to be told that it's not. -- 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] unscriptable?

2008-04-18 Thread Greg Ewing
Michael Foord wrote: > It seems to be more common in the 'Python world' to refer to indexing > than subscription Especially since the subscript isn't actually written as a subscript, unless you have a particulary fancy cod

Re: [Python-Dev] unscriptable?

2008-04-19 Thread Greg Ewing
ndex", on the other hand, directly suggests the idea of looking something up, without relying on indirection through typography and mathematical convention. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/list

Re: [Python-Dev] thoughts on having EOFError inherit from EnvironmentError?

2008-04-21 Thread Greg Ewing
program's control, but which aren't detected and reported by any of the built-in IOError or OSError exceptions. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mai

Re: [Python-Dev] A smarter shutil.copytree ?

2008-04-21 Thread Greg Ewing
Steven Bethard wrote: I'm not a big fan of the sequence-or-callable argument. Why not just make it a callable argument, and supply a utility function Or have two different keyword arguments, one for a sequence and one for a callable. --

Re: [Python-Dev] BSDDB3

2008-04-24 Thread Greg Ewing
Martin v. Löwis wrote: Ok. Jesus, can you please send me your SSH key? Nice to see that Heaven is security conscious and accepting encrypted prayer nowadays. :-) -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org

Re: [Python-Dev] Warn about mktemp once again?

2008-04-28 Thread Greg Ewing
e object instead of a file descriptor, since that's what you really want most of the time. At least I always end up calling fdopen on it. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsub

Re: [Python-Dev] Warn about mktemp once again?

2008-04-28 Thread Greg Ewing
s the named-ness of it rather useless, as far as I can see. If you don't want that to happen, you have to use mkstemp. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscr

Re: [Python-Dev] Warn about mktemp once again?

2008-04-28 Thread Greg Ewing
Certainly there's no way to tell whether you want it treated as binary, so at least that much of the mode needs to be specified. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe

Re: [Python-Dev] Warn about mktemp once again?

2008-04-29 Thread Greg Ewing
give you a file that *doesn't* go away when you close it, and has a name so you can go on to do other things with it. So I plead ignorance due to misleading documentation. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.

Re: [Python-Dev] Problems with the new super()

2008-05-01 Thread Greg Ewing
I ended up finding better solutions. So if it were up to me, I wouldn't be putting any effort into making it easier to use. I'm actually worried that making it too easy to use could lead people into using it when it's not appropriate. -- Greg _

Re: [Python-Dev] Problems with the new super()

2008-05-01 Thread Greg Ewing
yword. Conversely, I would say that if it doesn't deserve a keyword, it also doesn't deserve that much magic. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/

Re: [Python-Dev] Problems with the new super()

2008-05-01 Thread Greg Ewing
be for, but I can't see it working properly except under very special circumstances -- so special that they have never turned up in any code I've written so far. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.o

Re: [Python-Dev] Problems with the new super()

2008-05-01 Thread Greg Ewing
matters by delegating to one or another of the inherited classes (using explicit inherited method calls, not super!). If it's not feasible to do that for some reason, then you're better off forgetting about multiple inheritance and finding some other solution to the problem

Re: [Python-Dev] Problems with the new super()

2008-05-01 Thread Greg Ewing
ys as well, so I've come to regard multiple inheritance issues as a code smell suggesting that I need to rethink something. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

Re: [Python-Dev] PEP 8: Discourage named lambdas?

2008-05-04 Thread Greg Ewing
Maybe "def is an executable statement" is another thing people have a blind spot about? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/opt

Re: [Python-Dev] Next PyPy sprint in Berlin, 17-22 May

2008-05-04 Thread Greg Ewing
Armin Rigo wrote: More precisely, the sprint will be in the crashed c-base space station, Berlin, Germany, Earth, Solar System. You have a crashed space station in Berlin? Wow! I hope it didn't come down on anything important... -- Greg ___ P

Re: [Python-Dev] Dotted/indexed defs ? Re: PEP 8: Discourage named lambdas?

2008-05-05 Thread Greg Ewing
like. One small problem is that there would be no sensible name to give the function object, but that's no worse than what you get when using a lambda. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/

Re: [Python-Dev] [Python-3000] Invitation to try out open sourcecode review tool

2008-05-05 Thread Greg Ewing
Terry Reedy wrote: In any case, American programmers are not 'average' Americans ;-). So I say use it! Plus, think of all the millions of people who will have their lives enriched by learning to spell 'Rietveld' properly! -- Greg __

Re: [Python-Dev] Invitation to try out open source code review tool

2008-05-06 Thread Greg Ewing
into his designs. -- 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] Warn about mktemp once again?

2008-05-06 Thread Greg Ewing
Tristan Seligmann wrote: The correct way to do this is to create a temporary directory, and then generate a filename underneath that directory to use. Yes, otherwise you can get bitten by the race condition that's the reason for mktemp being deprecated. --

Re: [Python-Dev] [Python-3000] Reminder: last alphas next Wednesday 07-May-2008

2008-05-06 Thread Greg Ewing
tically without being told about 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] [Python-3000] Reminder: last alphas next Wednesday 07-May-2008

2008-05-06 Thread Greg Ewing
Steve Holden wrote: If you want it visible, make a visible symbolic link! I have to know it's there first. The idea of an installer deliberately hiding stuff from me in a very unconventional and non-obvious way makes me uncomfortable. --

Re: [Python-Dev] [Python-3000] PEP 370 (was Re: Reminder: last alphas next Wednesday 07-May-2008)

2008-05-06 Thread Greg Ewing
Guido van Rossum wrote: The location will be somewhere under ~/.local for Unix/Linux/OS X, Can I just put in a plea for this to be somewhere under ~/Library on OSX, and not hidden? MacOSX already has clear conventions for this sort of thing -- there's no need to use a dot-name there. --

Re: [Python-Dev] Warn about mktemp once again?

2008-05-07 Thread Greg Ewing
Antoine Pitrou wrote: When you write a processing script for internal use there's no reason to worry about security issues like that Even without security issues, there's still the potential for two processes creating temp files at the same time to trip over each other

Re: [Python-Dev] sock.close() not closing?

2008-05-07 Thread Greg Ewing
ng on whether you're expecting to get a copy of the file descriptor or not. -- 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] PEP 370 (was Re: Reminder: last alphas next Wednesday 07-May-2008)

2008-05-07 Thread Greg Ewing
Christian Heimes wrote: Can you come up with a path that fits the purpose of a base directory? "~/Library/Application Support/Python" would seem to be appropriate. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.

Re: [Python-Dev] [Python-3000] PEP 370 (was Re: Reminder: last alphas next Wednesday 07-May-2008)

2008-05-07 Thread Greg Ewing
s it's for installing 3rd party packages. So the obvious user-level analogy would be "~/Library/Python/x.y". -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http:

Re: [Python-Dev] On quote styles

2008-05-10 Thread Greg Ewing
and seen by the user, and 'xxx' is for things that are only used internally, e.g. enumerated type values and attribute names for use by getattr(). I wouldn't like to see any guideline that said you should only use double quotes or something like that. -- Greg _

Re: [Python-Dev] Encoding detection in the standard library?

2008-05-11 Thread Greg Wilson
tains facilities for indicating the encoding and other things as well. Yup, but DrProject (the target application) also serves as a relay and archive for email. We have no control over the agent used for composition, and AFAIK there's no standard way to include encoding in

Re: [Python-Dev] Adding start to enumerate()

2008-05-11 Thread Greg Ewing
Steven D'Aprano wrote: The only thing I can think of is printing lines with line numbers Parsing a file and wanting to be able to print error messages with line numbers would seem to be a fairly likely use. -- Greg ___ Python-Dev mailing list P

Re: [Python-Dev] Adding start to enumerate()

2008-05-13 Thread Greg Ewing
benefit from having access to implementation details of the string. -- 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] Addition of "pyprocessing" module to standard lib.

2008-05-13 Thread Greg Ewing
be meaningless. -- 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] Addition of "pyprocessing" module to standard lib.

2008-05-13 Thread Greg Ewing
Nick Coghlan wrote: Talin wrote: multiprocessing multiprocessing would work for me Me, too. -- 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] Addition of "pyprocessing" module to standard lib.

2008-05-14 Thread Greg Ewing
le cores, and a fancier one (maybe based on MPI) for people who want grid-computing style distribution with error handling, fault tolerance, etc. (I didn't set out to justify that paragraph, btw -- it just happened!) -- Greg ___ Python-Dev mai

Re: [Python-Dev] Addition of "pyprocessing" module to standard lib.

2008-05-14 Thread Greg Ewing
give the right impression? (Still allows for networking -- nobody says all the cores have to be on the same machine.:-) -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://

Re: [Python-Dev] Addition of "pyprocessing" module to standard lib.

2008-05-14 Thread Greg Ewing
at all can be, and is, referred to as "processing". So the intended meaning fails to come across. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.

Re: [Python-Dev] Python parallel benchmark

2008-05-15 Thread Greg Ewing
asn't, two threads would still only use one core's worth. Also, if you have only two cores, using more than two threads isn't going to gain you anything whatever happens. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mai

Re: [Python-Dev] Module renaming and pickle mechanisms

2008-05-17 Thread Greg Ewing
ng one situation here where it *is* a problem. -- 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] Issue 643841: Including a new-style proxy base class in 2.6/3.0

2008-05-20 Thread Greg Ewing
Nick Coghlan wrote: So what do people think of including a ProxyBase implementation in 2.6 and 3.0 that explicitly delegates all of the C-level slots to a designated target instance? Sounds good to me. -- Greg ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] Addition of "pyprocessing" module to standard lib.

2008-05-20 Thread Greg Ewing
Christian Heimes wrote: I assume recvfd and sendfd aren't syscalls but the proposed names for the functions. Yes, the functionality in question is accessed through the sendmsg() and recvmsg() system calls. -- Greg ___ Python-Dev mailing list P

Re: [Python-Dev] disappearing exceptions

2008-05-20 Thread Greg Ewing
Exception" recommendation (although that might still be an improvement over the status quo). -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/opt

Re: [Python-Dev] disappearing exceptions

2008-05-20 Thread Greg Ewing
I wrote: Shouldn't it only be catching AttributeError, though? Forget that, I forgot that PyObject_HasAttr can't signal an exception. The Py3 C API should be designed to fix this, I think. -- Greg ___ Python-Dev mailing list Python-Dev@

Re: [Python-Dev] Addition of "pyprocessing" module to standard lib.

2008-05-21 Thread Greg Ewing
Martin v. Löwis wrote: IIRC, it chokes on the attempt to compile assembler code that has C preprocessor macros in it (can't test it right now). Could the build process be modified to run the C preprocessor over the assembly language first? --

Re: [Python-Dev] Slice as a copy... by design?

2008-05-22 Thread Greg Ewing
of it. Some way of explicitly requesting a view into another string might be desirable, but it shouldn't be the default behaviour for string slicing. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/lis

Re: [Python-Dev] Issue 643841: Including a new-style proxy base class in 2.6/3.0

2008-05-27 Thread Greg Ewing
her 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] Issue 643841: Including a new-style proxy base class in 2.6/3.0

2008-05-27 Thread Greg Ewing
Nick Coghlan wrote: else: # Returned a different object, make a new proxy result = type(self)(result) You might want to check that the result has the same type as the proxied object before doing that. -- Greg ___ Python-Dev

[Python-Dev] A thought on generic functions

2008-05-28 Thread Greg Ewing
ed to me that this is something you can do with an OO system that you can't do so easily with a generic function system. If the operations being proxied were generic functions rather than methods, you'd have to override them all individually instead of having a central point to catch the

Re: [Python-Dev] Iterable String Redux (aka String ABC)

2008-05-28 Thread Greg Ewing
) already cover 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-archive.com

Re: [Python-Dev] Iterable String Redux (aka String ABC)

2008-05-28 Thread Greg Ewing
owing __iter__ would just seem perverse. A case could be made for strings being sliceable but neither indexable nor iterable, but it's probably too late to make such a radical change now. -- Greg ___ Python-Dev mailing list Python-Dev@pytho

Re: [Python-Dev] Iterable String Redux (aka String ABC)

2008-05-29 Thread Greg Ewing
Mike Klaas wrote: I agree that it would be perverse to disallowing iterating over a string. Just to be clear, I'm saying that it would be perverse to disallow iterating *but* to allow indexing of individual characters. Either you should have both or you should have neither. --

Re: [Python-Dev] Iterable String Redux (aka String ABC)

2008-05-29 Thread Greg Ewing
Georg Brandl wrote: Greg Ewing schrieb: > Doesn't isinstance(x, basestring) already cover that? That doesn't cover UserString, for example. A better solution to that might be to have UserString inherit from basestring. -- Greg _

Re: [Python-Dev] A thought on generic functions

2008-05-29 Thread Greg Ewing
to solving Yes, I agree with that. It was just something I thought of that shows that generic functions and OO are not quite equivalent in general. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/pyth

Re: [Python-Dev] A thought on generic functions

2008-05-29 Thread Greg Ewing
__getattr__ you know what you're doing can *only* affect the proxy object and nothing else. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/opt

Re: [Python-Dev] Iterable String Redux (aka String ABC)

2008-05-30 Thread Greg Ewing
Georg Brandl wrote: Greg Ewing schrieb: A better solution to that might be to have UserString inherit from basestring. But with that argument you could throw out the whole ABC machinery, just let all lists inherit from list, all dicts from dict, etc. Well, I'm skeptical about the whol

Re: [Python-Dev] Iterable String Redux (aka String ABC)

2008-06-01 Thread Greg Ewing
think that the ABC idea in general suffers from that problem, to one degree or another depending on the class involved. Strings are just an extreme case. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/

Re: [Python-Dev] Iterable String Redux (aka String ABC)

2008-06-01 Thread Greg Ewing
be a lost cause, since it will never be acceptable in those places, whatever is done with ABCs. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/op

Re: [Python-Dev] PEP 371: Additional Discussion

2008-06-03 Thread Greg Ewing
Benjamin Peterson wrote: I agree that the threading the the pyprocessing APIs should be PEP 8 compliant, but I think 2 APIs is almost worse than one wrong one. So change them both to be PEP 8 compliant, and leave aliases in both for existing code to use. -- Greg

Re: [Python-Dev] converting the stdlib to str.format

2008-06-04 Thread Greg Ewing
Nick Coghlan wrote: - remove support for passing a single value to a format string without wrapping it in an iterable first But won't that clobber a large number of the simple use cases that you want to keep %-formatting for? -- Greg ___ Pytho

Re: [Python-Dev] converting the stdlib to str.format

2008-06-05 Thread Greg Ewing
eem like a good idea 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] converting the stdlib to str.format

2008-06-05 Thread Greg Ewing
re all realised at once. The cost-benefit analysis needs to take the entropy into account somehow. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/opt

Re: [Python-Dev] converting the stdlib to str.format

2008-06-05 Thread Greg Ewing
e able to write that as "...{num}...".format(num = 2) -- 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] bug or a feature?

2008-06-10 Thread Greg Ewing
Maciej Fijalkowski wrote: What do you think about this code: class A: locals()[42] = 98 Seems people rely on it working. Do we consider it part of python language? Modifying the dict returned by locals() is documented as NOT being guaranteed to work, isn't it? --

Re: [Python-Dev] Python FAQ: Why doesn't Python have a "with" statement?

2008-06-14 Thread Greg Ewing
x27;s any substantial need for it. I don't believe there is in Python, because you can always put a reference to the target object into a succinctly-named local and access it through that. You can't always do that in Pascal, because it provides no way of obtaining a pointer a record that

Re: [Python-Dev] Python FAQ: Why doesn't Python have a "with" statement?

2008-06-14 Thread Greg Ewing
essionable minds of new programmers, IMO. -- 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] Proposal: add odict to collections

2008-06-15 Thread Greg Ewing
; or maybe "keyed list" would be a better term for the first variety. And "sorted dict" seems like a good enough term for the other one. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo

Re: [Python-Dev] Python FAQ: Why doesn't Python have a "with" statement?

2008-06-15 Thread Greg Ewing
use it in tutorials, where it's the first thing the newcomer will see, and get the impression that it's the normal thing to do. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubs

Re: [Python-Dev] C API for gc.enable() and gc.disable()

2008-06-19 Thread Greg Ewing
ts in existence, increase the threshold for performing GC by some factor. You would also want to do the opposite, so that a GC pass which reclaims a large proportion of objects would reduce the threshold back down again. -- Greg ___ Python-Dev mailing list P

Re: [Python-Dev] Proposal: Run GC less often

2008-06-21 Thread Greg Ewing
er of objects on the heap grows Wouldn't it be simpler just to base the collection frequency directly on the total number of objects in the heap? From what another poster said, this seems to be what emacs does. -- Greg ___ Python-Dev mailing list

Re: [Python-Dev] Proposal: Run GC less often

2008-06-22 Thread Greg Ewing
Martin v. Löwis wrote: Wouldn't it be simpler just to base the collection frequency directly on the total number of objects in the heap? Using what precise formula? The simplest thing to try would be middle_collections >= num_objects_in_heap * some_constant

Re: [Python-Dev] C API for gc.enable() and gc.disable()

2008-06-26 Thread Greg Ewing
might be when matching against a huge string. The behaviour you observed might have been due to the nature of the re being matched -- some res can have quadratic or exponential behaviour all by themselves. -- Greg ___ Python-Dev mailing list Python-Dev@

Re: [Python-Dev] [Python-checkins] r64424 - in python/trunk:Include/object.h Lib/test/test_sys.py Misc/NEWSObjects/intobject.c Objects/longobject.c Objects/typeobject.cPython/bltinmodule.c

2008-06-26 Thread Greg Ewing
Raymond Hettinger wrote: To me, the one obvious way to convert a number to a eval-able string in a different base is to use bin(), oct(), or hex(). What use cases are there for an eval-able representation of a float in those bases, as opposed to a human-readable one? -- Greg

Re: [Python-Dev] repeated keyword arguments

2008-06-27 Thread Greg Ewing
tomer filiba wrote: >>> def f(**kwargs): ... print kwargs ... >>> f(a=5,b=7,a=8) {'a': 8, 'b': 7} >>> I can't think of any reason why one would need to be able to write such code, or even want to. -- Greg __

Re: [Python-Dev] urllib, multipart/form-data encoding and file uploads

2008-06-27 Thread Greg Ewing
s not supported. -- 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] Cycle collection enhancement idea

2008-06-28 Thread Greg Ewing
just relying on cyclic GC? -- 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] Cycle collection enhancement idea

2008-06-29 Thread Greg Ewing
en classes, functions and the module dict, are unlikely to contain objects with ___del__ methods, so there wouldn't be much of a problem in practice. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-

Re: [Python-Dev] unittest's redundant assertions: asserts vs. failIf/Unlesses

2008-07-13 Thread Greg Ewing
Ben Finney wrote: That's another reason to avoid "assert" in the name: these methods *don't* necessarily use the 'assert' statement. Avoiding the implication that they do use that is a good thing. Perhaps some positive alternative such as "veri

Re: [Python-Dev] unittest's redundant assertions: asserts vs. failIf/Unlesses

2008-07-13 Thread Greg Ewing
ntion is chosen, there will be situations in which you want to mentally negate it. If you start with a positive, the mental negation produces a single negative. If you start with a negative, the mental negation produces a double negative. Therefore it is less confusing overall to start with as few n

Re: [Python-Dev] PEP: Consolidating names and classes in the `unittest`module (updated 2008-07-15)

2008-07-15 Thread Greg Ewing
on names, they could be read either way, so it comes down to readability. To my eyes there is no loss of readability when omitting the underscores, so simplicity argues for leaving them out. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://ma

Re: [Python-Dev] PEP: Consolidating names and classes in the `unittest` module (updated 2008-07-15)

2008-07-15 Thread Greg Ewing
that it's a test framework, would a programmer really find it hard to guess what these mean? -- 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] PEP: Consolidating names and classes in the `unittest`module (updated 2008-07-15)

2008-07-15 Thread Greg Ewing
owever, that meaning doesn't quite seem to fit here, as we don't just want to claim that the condition is false, but *ensure* that it's false. I can't think of a single word offhand that means that. -- Greg ___ Python-Dev m

Re: [Python-Dev] [Python-3000] No beta2 tonight

2008-07-18 Thread Greg Ewing
databases, but what about people with existing bsddb files that they need to read? -- 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-d

Re: [Python-Dev] Infix operators

2008-07-23 Thread Greg Ewing
r, invent a new type that behaves the way you want. -- 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] Infix operators

2008-07-23 Thread Greg Ewing
ng that can be treated as a 2D sequence. Why matrix multiplication in particular? Because it's the one thing that you do all the time with matrices for which there isn't an available operator. I think this one addition could be justified on the grounds of very wide usage. -- Greg ___

Re: [Python-Dev] Close PEP 211? (was Re: Infix operators)

2008-07-23 Thread Greg Ewing
ication in both Python and numpy? -- 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

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