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

2010-03-03 Thread Greg Ewing
ix 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__ and bytecode-only

2010-03-03 Thread Greg Ewing
x27;t think this ought to increase the stat call count, since the interpreter will always be looking for a particular version of bytecode, so it can just stat for the appropriate subdirectory directly. -- Greg ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] [PEP 3148] futures - execute computations asynchronously

2010-03-06 Thread Greg Ewing
ion of use cases to ignore the fact that the cancel failed and carry on regardless. If not, then raising an exception makes it much harder to accidentally ignore the situation. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.o

Re: [Python-Dev] argparse ugliness

2010-03-06 Thread Greg Ewing
thing meaningful in debugging output. But it also doesn't hurt to export named constants for them, in the interests of catching typos. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscr

Re: [Python-Dev] [PEP 3148] futures - execute computations asynchronously

2010-03-06 Thread Greg Ewing
27;ve been thinking for a while that it would be a big help if there were one, standardised module in the stdlib for handling async events, and all the other gui toolkits etc. were made to use it. -- Greg ___ Python-Dev mailing list Python-Dev@pytho

Re: [Python-Dev] [PEP 3148] futures - execute computations asynchronously

2010-03-06 Thread Greg Ewing
of the arguments is not a guaranteed part of the API. There isn't necessarily any need to enforce that, though. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.

Re: [Python-Dev] Modifying Grammar/grammar and other foul acts

2010-03-06 Thread Greg Ewing
is built, not the order of matching in a list of rules). -- 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 3148] futures - execute computations asynchronously

2010-03-06 Thread Greg Ewing
Michael Foord wrote: Wouldn't it have to be the Tcl event loop then? No, tcl/tk would have to be threatened with the comfy chair until it allowed itself to be spliced into the official event loop somehow. -- Greg ___ Python-Dev mailing list P

Re: [Python-Dev] argparse ugliness

2010-03-08 Thread Greg Ewing
Mark Russell wrote: Boolean flags are a common enough case that I'd be inclined to add a wrapper method, parser.add_bool_argument('--plot') +1, this looks good. -- Greg ___ Python-Dev mailing list Python-Dev@

Re: [Python-Dev] argparse ugliness

2010-03-08 Thread Greg Ewing
Steven Bethard wrote: Because the names are so long and you'd have to import them, I've left them as private attributes of the module, but if there's really demand, we could rename them to argparse.StoreTrueAction, etc. What's wrong with just

Re: [Python-Dev] [PEP 3148] futures - execute computations asynchronously

2010-03-08 Thread Greg Ewing
natural way to write things even if you don't care about the order, but you need all the results before proceeding. You're going to be held up until the longest-running task completes anyway, so it doesn't matter if some of them finish earlier and have to sit around waiting for

Re: [Python-Dev] argparse ugliness

2010-03-08 Thread Greg Ewing
some such instead of an Action: parser.add(options.Bool('--plot')) -- 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 3148] futures - execute computations asynchronously

2010-03-08 Thread Greg Ewing
ou could achieve the same thing just by assigning to a name in a module. In other words, instead of inventing your own mechanism for managing a namespace, just use a module as your namespace. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http:

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

2010-03-14 Thread Greg Ewing
X, it makes it impossible to look inside using the Finder if you want to, and it won't have any effect on Windows anyway. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] Decimal <-> float comparisons in py3k.

2010-03-16 Thread Greg Ewing
in 2.7 to match the current 3.x behaviour. -- 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 <-> float comparisons in py3k.

2010-03-16 Thread Greg Ewing
s to be explicit about how to do 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] Decimal <-> float comparisons in py3k.

2010-03-17 Thread Greg Ewing
nimum-digits basis. -- 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 <-> float comparisons in py3k.

2010-03-17 Thread Greg Ewing
ed number of decimal digits available, which you always do at any given moment with the Decimal type. And even if there are enough digits, an exact conversion mightn't be what you really want. This problem doesn't arise with int->float conversion -- there is only one obvious wa

Re: [Python-Dev] Decimal <-> float comparisons in py3k.

2010-03-17 Thread Greg Ewing
hon 2.5.4 (r254:67916, May 15 2009, 15:21:20) [GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 1+2j < 3+4j Traceback (most recent call last): File "", line 1

Re: [Python-Dev] Decimal <-> float comparisons in py3k.

2010-03-19 Thread Greg Ewing
half the problem, though? Even if you find that the hashes are equal, you still have to decide whether the values themselves are equal. Is there some similarly clever way of comparing two rational numbers without having explicit access to the numerators and denominators? --

Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-19 Thread Greg Ewing
Antoine Pitrou wrote: We forbid comparisons when there is a real danger or ambiguity, such as unicode vs. bytes. There is no such danger or ambiguity when comparing a decimal with a float. So do you think that float("0.1") and Decimal("0.1") should be equal or no

Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-19 Thread Greg Ewing
equality. -- 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 & lt; -& gt; float comparisons in py3k.

2010-03-19 Thread Greg Ewing
rational numbers, which can be done without loss of precision. -- 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] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-20 Thread Greg Ewing
.. despite some misguided souls occasionally storing them in floating point. :-) -- 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] Mixing float and Decimal -- thread reboot

2010-03-20 Thread Greg Ewing
float->float appears better, there seems to be another one for which Decimal+float->Decimal appears better. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.pyth

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-20 Thread Greg Ewing
produce an inexact result. It's not like an int or Fraction where the result can expand to whatever size is needed. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-20 Thread Greg Ewing
Nick Coghlan wrote: Note that Antoine's point was that float("0.1") and Decimal.from_float(0.1) should compare equal. That would mean that Decimal("0.1") != float("0.1"), which might be surprising to someone who didn't realise they w

Re: [Python-Dev] Attribute lookup ambiguity

2010-03-20 Thread Greg Ewing
on't get a chance to do anything else, so something outside of __getattribute__ must catch the AttributeError and calling __getattr__. So I think the docs *are* specifying the behaviour here, if only by implication. -- Greg ___ Python-Dev mailing

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-20 Thread Greg Ewing
Nick Coghlan wrote: int -> Decimal -> Fraction -> float -> complex I don't think it's a good idea to put Decimal below Fraction, because Decimal has to be considered an implicitly inexact type like float, and we don't want to coerce from an inexact typ

Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-21 Thread Greg Ewing
ppened to get a float mixed in somehow. There is no way of distinguishing between these automatically. -- 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] Mixing float and Decimal -- thread reboot

2010-03-21 Thread Greg Ewing
every decimal value would have a flag indicating whether it was tainted with inexactness, and this flag would propagate through calculations. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubs

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-21 Thread Greg Ewing
we're talking about would be done to whatever precision is set in the context. Am I wrong about that? Is the intention to always use enough digits to get an exact representation? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-21 Thread Greg Ewing
cimal operation is going to do. It's probably justified in this case, though. -- 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] Mixing float and Decimal -- thread reboot

2010-03-21 Thread Greg Ewing
cimal operation is going to do. It's probably justified in this case, though. -- 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 & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-21 Thread Greg Ewing
oating point numbers have limited precision. What really surprises people is when *binary* floating point numbers behave differently from the decimal ones they're used to. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.or

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-22 Thread Greg Ewing
for Decimals concern operations between two Decimals, and we have a Decimal and a Fraction here, so all bets could be considered off. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsub

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-22 Thread Greg Ewing
Cowlishaw appears to mean by "numbers are exact" is that Decimals represent particular values, not *intervals*. This is not really the same thing as the notion of inexact numbers in the numeric tower. There, it means more like "this number may not quite represent the value the programm

Re: [Python-Dev] PEP 3147, __pycache__ directories and umask

2010-03-22 Thread Greg Ewing
taller? I don't like the idea of being required to use an installation tool in order to get .pyc files. -- 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] __pycache__ creation

2010-03-22 Thread Greg Ewing
there, the attacker would have to be capable of either changing the owner of the parent directory or removing it and replacing it with a different one, and if he can do that, he can do whatever he wants anyway. -- Greg ___ Python-Dev mailing list Pytho

Re: [Python-Dev] Attribute lookup ambiguity

2010-03-22 Thread Greg Ewing
ncorrect to say that "__getattribute__ raises an exception". When we say that a function raises an exception, we normally mean that the exception propagates out of the function and can be seen by the caller, not that it was raised and caught somewhere insi

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-22 Thread Greg Ewing
Mark Dickinson wrote: It might make sense for Decimal + complex mixed-type operations to be disallowed, for example. As long as you're allowing Decimal-float comparisons, Decimal-complex comparison for equality has an obvious interpretation. --

Re: [Python-Dev] __pycache__ creation

2010-03-22 Thread Greg Ewing
Antoine Pitrou wrote: Having the Web server execute ad hoc system administration code is far from elegant and user-friendly. With the right piece of code, you could create yourself a setuid-apache shell and solve this problem once and for all. :-) -- Greg

Re: [Python-Dev] PEP 3147, __pycache__ directories and umask

2010-03-23 Thread Greg Ewing
ain* one. Personally I would benefit most from it during development. I hardly ever look in the directories of installed packages, so I don't care what they look like. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/ma

Re: [Python-Dev] __pycache__ creation

2010-03-23 Thread Greg Ewing
u can get it to make a copy of /bin/sh and suid it. Of course, if you have permission to su apache, then this is not necessary. But then you wouldn't have to go through web server contortions to fix apache-generated botchups either. -- Greg ___ Pyt

Re: [Python-Dev] __pycache__ creation

2010-03-23 Thread Greg Ewing
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] PEP 3147, __pycache__ directories and umask

2010-03-23 Thread Greg Ewing
.e. __pycache__ could be created but nothing could be written to it because of a umask issue. If you install in a shared site-packages by dragging, you already have to be careful about setting the permissions. You'd just have to be sure to extended that diligence to any contained __pycache__ d

Re: [Python-Dev] Attribute lookup ambiguity

2010-03-23 Thread Greg Ewing
tribute__ won't call __getattr__ on its own. I concede that the wording could be improved to remove any possibility of doubt, though. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-de

Re: [Python-Dev] PEP 3147, __pycache__ directories and umask

2010-03-24 Thread Greg Ewing
Isaac Morland wrote: the benefit to me and to Greg and to others writing .py code is that our directories will contain *.py and __pycache__, rather than *.py and *.pyc. So it will be much easier to see what is actually there. Yes. When using MacOSX I do most of my work using the Finder&#

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-24 Thread Greg Ewing
(I don't think that should be the case, BTW -- complex numbers live on a two-dimensional plane, and from a geometrical point of view there's no reason to single out the x-axis and give it special treatment.) -- Greg ___ Python-Dev mailing l

Re: [Python-Dev] Why is nan != nan?

2010-03-25 Thread Greg Ewing
#x27;s a *sane* compromise I'm not sure. -- 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] Mixing float and Decimal -- thread reboot

2010-03-25 Thread Greg Ewing
algorithms exist that benefit from Nan == NaN being false, so it's fair to ask for examples to back that up. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.pyt

Re: [Python-Dev] Why is nan != nan?

2010-03-25 Thread Greg Ewing
he payload of a NaN in typical hardware implementations is quite small, because it has to fit into the exponent field. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.pyt

Re: [Python-Dev] Why is nan != nan?

2010-03-25 Thread Greg Ewing
27;re *not* the same person, because it's meaningless to say *anything* about the properties of nonexistent people. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http:

Re: [Python-Dev] Why is nan != nan?

2010-03-25 Thread Greg Ewing
That gives us enough flexibility to make == do what we want and still claim compliance with the standard. BTW, does IEEE754 give us the same flexibility? If so, we may not have much of a problem in the first place. -- Greg ___ Python-Dev mailing list Python

Re: [Python-Dev] Why is nan != nan?

2010-03-25 Thread Greg Ewing
sting. :-) -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Why is nan != nan?

2010-03-28 Thread Greg Ewing
Steven D'Aprano wrote: I disagree -- if I ask: 3.0 in [1.0, 2.0, float('nan'), 3.0] I should get True, not an exception. Yes, I don't think anyone would disagree that NaN should compare unequal to anything that isn't a NaN. Problems only arise when com

Re: [Python-Dev] nonlocals() function?

2010-04-05 Thread Greg Ewing
in alphabetical order for quick scanning. Since I suspect this is most people's main use for dir(), I think it's a good enough reason for leaving things as they are. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.pyt

[Python-Dev] Scope object (Re: nonlocals() function?)

2010-04-05 Thread Greg Ewing
ace them with another function called something like scope(). It would return a mapping object that looks up names in the current scope. It could also improve on locals() by being writable. -- Greg ___ Python-Dev mailing list Python-Dev@python.

Re: [Python-Dev] python compiler

2010-04-05 Thread Greg Ewing
e that you'd be taking on a very challenging project -- at least if you intend the compiled code to be substantially faster than interpretation. You should also check out what others have been doing in this area: PyPy, Cython, Unladen Swallow. -- Greg __

Re: [Python-Dev] python compiler

2010-04-05 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] Scope object (Re: nonlocals() function?)

2010-04-06 Thread Greg Ewing
few locals, in which case building a dict containing all of them would be wasteful. -- Greg -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/

Re: [Python-Dev] python compiler

2010-04-06 Thread Greg Ewing
ate of the art, you first need to find out what the state of the art is. -- 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] Scope object (Re: nonlocals() function?)

2010-04-06 Thread Greg Ewing
ocals view" object shouldn't be too much harder. If it can't, then you have already given up full CPython compatibility. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe

Re: [Python-Dev] Python and compilers

2010-04-06 Thread Greg Ewing
were successful, I'd be interested in using 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 and compilers

2010-04-08 Thread Greg Ewing
create the appropriate backend to target the machine in question. I wouldn't like to rely on a generic C-generating backend to target something very tiny in an effective way. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.pytho

[Python-Dev] Traceback object has no __class__?

2010-04-11 Thread Greg Ewing
ss.py Traceback (most recent call last): File "traceback_class.py", line 8, in print tb.__class__ AttributeError: __class__ -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Uns

Re: [Python-Dev] Traceback object has no __class__?

2010-04-13 Thread Greg Ewing
Nick Coghlan wrote: I'm not sure what build you're getting that behaviour on, but my svn build of 2.6 has a __class__ attribute for traceback objects, It's 2.6.1. Guess it's been fixed since then. -- Greg ___ Python-Dev mai

Re: [Python-Dev] stdlib socket usage and "keepalive"

2010-04-13 Thread Greg Ewing
is subject to uncertain delays, so how long do you wait for a reply before deciding that the connection is dead? If you don't wait long enough, you could end up killing a connection that would have come back if you had waited longer. -- Greg ___ Python

Re: [Python-Dev] Fwd: Broken link to download (Mac OS X)

2010-04-14 Thread Greg Ewing
t the normal "./configure; make; make install" sequence works fine without any further intervention. If you want a framework installation you have to read the README and use a couple of extra options, but it still works very smoothly. -- Greg ___

Re: [Python-Dev] Very Strange Argument Handling Behavior

2010-04-16 Thread Greg Ewing
says "TypeError: Keyword dict contains non-string keys", but upon examination, the dict clearly does not contain any such thing? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Uns

Re: [Python-Dev] Reasons behind misleading TypeError message when passing the wrong number of arguments to a method

2010-05-20 Thread Greg Ewing
en you understand exactly what's going on, it's annoying having to make the mental adjustment every time. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.py

Re: [Python-Dev] Reasons behind misleading TypeError message when passing the wrong number of arguments to a method

2010-05-20 Thread Greg Ewing
x27; is the traditional term used when talking about that. I can't think of anything that would be more accurate without being excessively verbose or pedantic. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman

Re: [Python-Dev] Reasons behind misleading TypeError message when passing the wrong number of arguments to a method

2010-05-20 Thread Greg Ewing
o call the function underlying the bound method, at which point it can't be distinguished from any other way of calling it. However, it could be made to raise a special subclass of TypeError that the bound method wrapper could catch and replace with its own exce

Re: [Python-Dev] Reasons behind misleading TypeError message when passing the wrong number of arguments to a method

2010-05-20 Thread Greg Ewing
no longer exist in Py3, so you would get the standard message about incorrect number of arguments instead. Not sure whether that's better or worse in this situation. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mail

Re: [Python-Dev] PEP 3148 ready for pronouncement

2010-05-23 Thread Greg Ewing
for stdlib inclusion. -- 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 3148 ready for pronouncement

2010-05-23 Thread Greg Ewing
for Python. Slavishly copying an API from another language is often not the best approach when designing an API for a Python module. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscr

Re: [Python-Dev] PEP 3148 ready for pronouncement

2010-05-23 Thread Greg Ewing
much discussion there is and how much apparent agreement is reached, it's no substitute for practical experience. Often API design mistakes are only found when trying to use the library for real. -- Greg ___ Python-Dev mailing list Python-Dev@pytho

Re: [Python-Dev] PEP 3148 ready for pronouncement

2010-05-23 Thread Greg Ewing
Andrew Svetlov wrote: BTW, is 'cancelled' correct name? Spell-checkers likes only single 'l' form: 'canceled'. I think this is an English vs. American thing. Double 'l' looks right to me, but then I was brought up as a loyal subject of the antipodean br

Re: [Python-Dev] PEP 3148 ready for pronouncement

2010-05-26 Thread Greg Ewing
ve more than one Executor active at a time? The fact that as_completed() is a module-level function rather than an Executor method suggests that it is, but it would be good to have this spelled out one way or the other in the PEP. -- Greg ___ Python-Dev

Re: [Python-Dev] PEP 3148 ready for pronouncement

2010-05-26 Thread Greg Ewing
arily going to be easy for him to follow. * Is it possible to have more than one Executor active at a time? Of course. That's good, but I don't think that the "of course" is at all obvious, considering that things such as GUI

Re: [Python-Dev] variable name resolution in exec is incorrect

2010-05-26 Thread Greg Ewing
op-level code is screwy in the first place. Are there any use cases for it? Maybe the second scope argument to exec() should be deprecated? -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubs

Re: [Python-Dev] PEP 3148 ready for pronouncement

2010-05-26 Thread Greg Ewing
ks to finish to explicitly wait for that to happen. Also, automatically doing (2) would seem to make it difficult for a program to bail out if something unexpected happens. It would have to explicitly shut down the thread pool instead of just letting an exception prop

Re: [Python-Dev] PEP 3148 ready for pronouncement

2010-05-26 Thread Greg Ewing
ather than adding another module that provides almost exactly the same thing with different options? -- 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] variable name resolution in exec is incorrect

2010-05-26 Thread Greg Ewing
On 27/05/10 11:33, Michael Foord wrote: On 27/05/2010 00:38, Greg Ewing wrote: Maybe the second scope argument to exec() should be deprecated? Sounds good to me, certainly ends the confusion over this undoubtedly unintuitive behaviour. :-) Although it's a fair point that it can be u

Re: [Python-Dev] PEP 3148 ready for pronouncement

2010-05-26 Thread Greg Ewing
. I was referring to the issue of ThreadPool vs. ThreadPoolExecutor etc. By your own argument above, concurrent.futures.ThreadPool is quite descriptive enough of what it provides. It's not a problem if some other module also provides something called a ThreadPool

Re: [Python-Dev] variable name resolution in exec is incorrect

2010-05-26 Thread Greg Ewing
fell out of the implementation. The function in the interpreter that executes code objects requires two namespaces as arguments, and they were both exposed via exec just in case anyone found a use for them. -- Greg ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] variable name resolution in exec is incorrect

2010-05-26 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] variable name resolution in exec is incorrect

2010-05-26 Thread Greg Ewing
= dict(__builtins__ = stuff) exec(code, g) del g['__builtins__'] -- 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 3148 ready for pronouncement

2010-05-27 Thread Greg Ewing
son I'd use such a module rather than just spawning a thread myself for each task. -- 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 3148 ready for pronouncement

2010-05-27 Thread Greg Ewing
Nick Coghlan wrote: We can accept PEP 3148 by saying that we're happy to add the extra namespace level purely for disambiguation purposes, If that's the only rationale for the namespace, it makes it sound like a kludge to work around a poor choice of name

Re: [Python-Dev] tp_dealloc

2010-05-31 Thread Greg Ewing
x27;t set up, because code further along the tp_dealloc chain may rely on it. That includes fields in the object header. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://ma

Re: [Python-Dev] Are PyCFunctions supposed to invisibly consume self when used as a method?

2010-06-12 Thread Greg Ewing
Guido van Rossum wrote: bind the instance to the first argument when it is called on an instance. I can't think of a good name for that one right now, but we'll think of one. dynamicmethod? -- Greg ___ Python-Dev mailing list Python-Dev@

Re: [Python-Dev] UserDict in 2.7

2010-06-22 Thread Greg Ewing
left out of the ABC ecosystem. No worse than what happens to any other existing user-defined class that predates ABCs -- if people want them to inherit from ABCs, they have to update their code. In this case, the update would consist of changing subclasses to inherit from list or dict instead. --

Re: [Python-Dev] os.getgroups() on MacOS X Was: red buildbots on 2.7

2010-06-24 Thread Greg Ewing
Ronald Oussoren wrote: That's because setgroups(3) is limited to 16 groups > (that is, the kernel doesn't support more than 16 groups at all). So how does an account being a member of 18 groups ever work? -- Greg ___ Python-Dev mailin

Re: [Python-Dev] versioned .so files for Python 3.2

2010-06-24 Thread Greg Ewing
. Not exactly the same, but closely related. -- 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] thoughts on the bytes/string discussion

2010-06-24 Thread Greg Ewing
tract string-access API would have to be devised, and all existing C code updated to use it. Also, this new API would not be as easy to use as the number API, because it would involve asking for the data in some specified encoding, which would require memory allocation and management. --

Re: [Python-Dev] thoughts on the bytes/string discussion

2010-06-26 Thread Greg Ewing
ython with UTF-8 as the internal string representation? -- 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] thoughts on the bytes/string discussion

2010-06-27 Thread Greg Ewing
Stefan Behnel wrote: Greg Ewing, 26.06.2010 09:58: Would there be any sanity in having an option to compile Python with UTF-8 as the internal string representation? It would break Py_UNICODE, because the internal size of a unicode character would no longer be fixed. It's not fixed a

Re: [Python-Dev] thoughts on the bytes/string discussion

2010-06-27 Thread Greg Ewing
e memory. If they do that, they also need to deal with sequence items not corresponding to characters. If they can handle that, they may be able to handle utf-8 just as well. -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.

Re: [Python-Dev] bytes / unicode

2010-06-28 Thread Greg Ewing
ressed into service as an infix operator, with s...@i being equivalent to s[i:i+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/

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