-associative, which is a
much rarer and more surprising thing. We do
at least have
('1' + '2') + '3' == '1' + ('2' + '3')
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.py
faded into the sunset, we can start
aliasing 'python' to 'python3' if we want, can't we?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
altinstall
and fullinstall that aliases 'python3' but not 'python',
and make that the default. Maybe call it 'install3'.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo
own, and is
awaiting a verdict from Guido.
The prototype implementation doesn't quite match
the PEP in some of the fine details yet. Also
it's for 2.6 rather than 3.x; someone with more
knowledge of 3.x internals would be better placed
than me to convert it.
--
Greg
__
think
Ruby's extension API is ahead in this particular area.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
__reduce__, etc.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
MRAB wrote:
Next you'll be saying that they should be named after years. Python
2010, anyone? :-)
To keep people on their toes, we should switch to a
completely random new naming scheme with every release,
like Microsoft has been doing with Windows.
--
Antoine Pitrou wrote:
you can't be sure all the responders are
over 18. Actually, they might even not be human beings!
(hint: I'm not)
Not over 18, or not a human being?
--
Greg
___
Python-Dev mailing list
Python-Dev@pytho
is that the REPL needs to keep reading
lines until it gets a completely blank one. I don't
see why the compiler has to treat the source any
differently once the REPL has decided how much text
to feed it.
--
Greg
___
Python-Dev mailing list
Python-De
umber of sources, and I don't usually pay much
attention to exactly where they're coming from. I just
hit reply-all and trust that it will go somewhere
sensible.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/m
when dealing with buffered streams.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
s "creation" are still likely to confuse them.
Why not give it a more explicit name, such
as "st_creationtime"?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Cameron Simpson wrote:
For myself, I'd expect more often to want to see if there's stuff in the
buffer _without_ doing any raw reads at all.
What uses do you have in mind for that?
--
Greg
___
Python-Dev mailing list
Python-Dev@pytho
don't play
well with other things like select().
Anyhow, I wouldn't be opposed to having a way of looking
into the buffer, but it should be a separate API --
preferably with a better name than peek0(), which gives
no clue at all about what it does differently from p
as peek() that doesn't explicitly
mention the buffer should fit into the abstraction
properly.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
PyModule_AddObject an
oddity?
I ask because I've been thinking about adding features
to Pyrex for dealing with stolen references, and it
could be important to know things like this.
Also, if it's an oddity, it would be a good idea
to mention this behaviour in the docs
Christian Heimes wrote:
But it is a convenient oddity nonetheless.
What's convenient about it? Seems to me it's the
opposite, since you can't just bail out if it
fails, but have to decref the reference you
thought it was going to take care of fo
and that limit needs to be documented
so that people can write correct programs.
This is true of both kinds of peeking, so I
concede that they both break the abstraction.
However I think the non-blocking peek breaks it
more than the blocking one, because it also
brings non-deterministic behaviour.
--
G
()
That's exactly why I think the blocking version should
keep reading until the requested number of bytes is
available (or the buffer is full or EOF occurs).
In other words, the blocking version should be fully
deterministic given knowledge of the buffer size.
--
Lucas P Melo wrote:
Am I understanding this correctly:
* The blocking version would not do any raw reads.
No, the blocking version would keep doing raw reads
until the buffer contains enough bytes.
--
Greg
___
Python-Dev mailing list
Python-Dev
e
world if it failed !!
Although personally, if something might cause the end
of the world if it failed, I'd prefer not to attempt it
in the first place !!
--
Apocalypse Python !! - If you ever need to use it, you're
in deep trouble... !!
Greg !!
__
P.J. Eby wrote:
In effect, 2.6 forces you to have a common known base class *other* than
'object' in order to write co-operative classes. :-(
You have to do that anyway if you want to make cooperative
calls to any method *other* that __init__
er consequences follow.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
ncern would be if it were somehow possible
to crash the interpreter by modifying the type dict.
I don't see how that could happen -- but maybe someone
else on python-dev knows more about this?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
I can give you
further details.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
The decision on whether to include
something in the stdlib needs to be based on the wider
picture.
In this case, it's trivial to write your own if you want
it. As they say, "not every one-line function needs to
be in the stdlib".
--
Greg
___
o anything
disastrous happening.
Note that by not giving instances a __dict__, they
will be prevented from having arbitrary attributes
set on them, which is the most noticeable distinction
between built-in and user-defined types.
--
Greg
___
Python-Dev ma
umping-ahead. (Sorry it's in C++,
I hadn't discovered Python when I wrote it.)
[1] Pierre L'Ecuyer, Good Parameters and Implementations for
Combined Multiple Recursive Random Number Generators,
Operations Research v47 no1 Jan-Feb 1999
http://www.iro.umontreal.
Martin Zugnoni wrote:
when I press
the triple zero key once, I receive three events from the single zero key.
I need to make a disctintion between these keys
Sounds like you can't, except perhaps by detecting
three '0' key events arriving at almost the same
would introduce
would be a good idea.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
nd changing it would break a lot of code for no good
reason.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
--
the BDFL has rejected similar suggestions on previous
occasions.)
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
not* to be.
Maybe we need a flag when registering an atexit handler
to indicate whether it should be kept across forks?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.
able -- if it's empty,
there's no way that calling the object could ever
succeed, so you might as well fail early.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mai
Benjamin Peterson wrote:
It depends on whether you're keeping the "callable" object around or
not. Somebody could add a __call__ method later.
Good point. Removing the check sounds like the
right thing to do, then.
--
Greg
___
Pyt
Xavier Morel wrote:
Methods yes (and that's one of the few Smalltalk design "features" I
consider truly dumb, considering it has message cascading)
Cascading is something different -- it's for sending
multiple messages to the *same* receiver. It's not
du
fault for %-formatting is actually right alignment
for *all* types, including strings.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/pytho
dress in that network.
If that's true, then you *can't* calculate the network
address from a host address and a netmask -- there isn't
enough information. Furthermore, an IPNetwork object
needs to be able to represent a network address whose
address part contains bits that aren
an
(IPNetwork, IPAddress) pair, or attaching a 'network'
attribute to an IPAddress, or some other solution
when the need arises.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
(ip_number)
Address(ip_number, network = )
Address(ip_number, mask = )
# constructs and attaches a suitably-masked Network instance
We could also have some_network[n] return an Address
referring back to the network object it was obtained
from
o address on its own
has, but if it's considered useful enough to have an
attribute for it, calling it something like 'base_address'
would be less confusing.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/ma
Peter Moody wrote:
the address with all of the hosts bits masked to zero is most commonly
referred to as the network address.
Then call the attribute 'network_address', not just 'network'.
--
Greg
___
Python-Dev mailing list
P
they do in v4, then there's no need to iterate
over anything -- it's just a matter of turning on all
the low bits of the address.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-de
en working cross-platform.
What we could do with is better platform-independent
ways of distinguishing particular error conditions,
such as file not found, out of space, etc., either
using subclasses of IOError or mapping error codes
to a set of platform-independent ones
code, e.g.
try:
something_with_file(path)
except EnvironmentError, e:
report_error("Couldn't do that with %s: %s" % (path, e))
This is a pattern I use a lot, and it seems to work
pretty well.
--
Greg
___
Python-Dev mailing
ented it and left it that way.
Then the POSIX committee came along and incorporated it into
the standard so as to be compatible with existing practice.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailma
term, that had better be replaced asap.
There's something to be said for that, but there's also
something to be said for following established conventions,
and there's a long-established precedent from the C library
for having a function called tr
d before
x.__op__(y).
How does this work at the C typeslot level, where
there are no __rop__ methods?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailm
ction heading in the docs.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
an
__rop__ method distinct from the __op__ method?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
ographical term that is at best a metaphor when
applied to a language written linearly.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/pyt
ror (filepath max lengths, or "? / : " characters in
a windows file name...)
This might be a bit too precise. Unix just has EINVAL, which
covers any kind of invalid parameter, not just file names.
--
Greg
___
Python-Dev mailing list
Python-Dev@py
t "strict=False" covers,
I think I'd rather have a separate constructor function
or method for this, rather than a somewhat cryptically
named boolean parameter.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.o
e improved, but that's an
orthogonal issue.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
ly said I was not going to do with ipaddr.
Would you be kind enough to explain exactly what use
case you have for retaining this information?
Apologies if you've done so before -- I've been
trying to follow this discussion, but that point
doesn't seem to have co
.
--
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
ay of sorting them out, then
obviously you can represent them using different
exceptions if you want.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/ma
is that it would have to be useful a
*lot* of the time, not just "sometimes", to be worth
having it on every IPNetwork object.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubs
Steven D'Aprano wrote:
there's a mathematical operator called the mediant:
mediant(a/b, c/d) = (a+c)/(b+d)
That's a function of four arguments, not two!
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.pyt
x27;s an art to coming up with an API that makes simple
things easy and other things possible. I'm not convinced that
argparse represents a subsantial enough advancement in
that art to justify replacing optparse with it in the stdlib,
and thereby forcing everyone to learn a similar-but-dif
;t just a "network", it's more
like "network plus the address of its interface". So
some people think that using the name "IPNetwork" for
this object is confusing.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
ht
Paul Moore wrote:
I'd rather argparse (or any library function)
didn't call sys.exit on my behalf - it should raise an exception.
Actually, sys.exit() *does* raise an exception (i.e.
SystemExit) that you can catch if you want.
--
Greg
___
arise, of course, but hopefully they
will be fairly rare, and raising an exception would point
out the problem and allow it to be fixed.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
is is overly burdensome in my
mind.
Seems to me what you want isn't so much an IPNetwork that
can optionally have an address, as an IPAddress that can
optionally have a mask, and methods for deriving those
other things from it.
--
Greg
___
Python-D
und, there will still be heaps of code around that
uses %-formatting, so it won't be possible to remove
it in 4.x either.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Uns
just special cases of 2, when you include
the empty-list case. So you're making it more complicated
in your mind than it really is.
Any chances of cleaning this one up for python 4?
I doubt that many other people will see anything
here that needs cle
ased on a
conceptually sound design.
Peter is of course within his rights not to change
his module in this way. But this just means that
ipaddr is not the right module to adopt, and we
should design another one and give it a different
name.
--
Greg
___
tion language. Maybe it stands for
"classic python". :-)
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
The only possible benefit is to allow latecomers to catch
up on the thread without having to consult any archives.
But I've never seen any complaints that people who *do*
quote responsibly are making this hard, so I can only
conclude that it's not a significa
sound any more useful. What would it
gain you? Why not just iterate over the set? Or make a
copy and repeatedly pop() it?
I completely fail to see a use case for this.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/m
dom index until it points to a non-empty slot.
But that's hardly O(1).
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Steven D'Aprano wrote:
I don't know how expensive it is to create a set iterator,
Not expensive enough to justify burdening the set type with
extra functionality that will be extremely rarely used.
--
Greg
___
Python-Dev mailing list
ly *does* want
to discourage such discussions.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Antoine Pitrou wrote:
The problem is when searching for /another/ object which hashes the same as
Decimal("NaN").
Maybe decimal NaNs should be unhashable, so that you can't
put them in a dictionary in the first place.
--
Greg
___
Pyt
nding
their way around text editors and command shells.
So, I'd say that, like democracy, it's not very good, but
it's better than any of the alternatives. :-)
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.o
a practically usable
state and it ever gets included in the core distribution,
then it might be a viable basis for a modernised version
of IDLE. That's probably a fairly long way off, though.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
h ones I actually
*do* use so I could mantain that list, something I don't
have to think about at the moment.
It mightn't be so bad if the whole stdlib were a *single*
package, but I don't see much advantage in that.
--
Greg
__
is is a regression error, since
Python 2.x does not exhibit the same behaviour.
Can anybody confirm this?
Greg Hewgill
http://hewgill.com
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
ion value in a python2/3 portable way
a = sys.exc_info()[1]
a.__traceback__ = None
I have added a doc bug issue for this: http://bugs.python.org/issue7340
Greg Hewgill
http://hewgill.com
___
Python-Dev mailing list
Python-Dev@p
You could use a class:
class factorial():
def fac(self, n):
if n == 0:
return 1
else:
return n * self.fac(n - 1)
def __call__(self, n):
return self.fac(n)
factorial = factorial()
print factorial(5)
--
Greg
abouts in the docs to put information
about this, however. It really relates to a certain
pattern of using language features rather than to any
particular feature.
Maybe there should be a section devoted to avoidance of
reference cycles where all of these known pitfalls can
etime
objects are naive unless you explicitly specify a
timezone.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%4
27;re extremely dangerous, because the GUI
side of win2k doesn't know about them. It thinks that a
symlink to a folder is a real folder, and if you delete
it, you end up deleting the contents of the folder that
the symlink points to. So if you use them, you need to
keep
Reminiscent of INTERCAL, where you had to say PLEASE at
regular but not too frequent intervals, or the compiler
would accuse you of being either too impolite or too
smarmy.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http
ite a custom import hook.
What
I don't like this idea at all. I object to being forced to
jump through an obscure hoop to do something that's been
totally straightforward until now.
--
Greg
___
Python-Dev mailing list
Python-Dev@
Michael Foord wrote:
I thought we agreed at the language summit that if a .pyc was in the
place of the source file it *could* be imported from - making pyc only
distributions possible.
Ah, that's okay, then. Sorry about the panic!
--
Meador Inge wrote:
3. Using Decimal keeps the desired precision,
Well, sort of, but then you end up doing arithmetic in
decimal instead of binary, which could give different
results.
Maybe the solution is to give ctypes long double objects
the ability to do arithmetic?
--
Greg
ed to get in, but it makes it
hard for them to argue in court that they wandered in
accidentally.
Also it may make it easier to get the idea of using
Python past PHBs. That seems to me like a good reason
for keeping the feature.
--
Greg
___
Python-Dev mai
amines the contents of the file to figure out what it is,
in order to support running .pyc files from the command line.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.
Decimal type so that it gives identical results to that
of any IEEE binary floating point type, including rounding
behaviour, denormalisation, etc.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-
tory would only have to be done once
per package and the result remembered, so it would
add very little overhead.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.
lly a binary file.
So on balance I think it's a bit too kooky for my
taste.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
ake significant time compared to loading the module?
Once you've looked for one file in a given directory, looking
for another one in the same directory ought to be quite fast,
since all the relevant directory blocks will be in the
filesystem cache.
--
Greg
_
calls are negligible
once the cache is warmed up.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
llow you to
apply that action to it.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
sourceful program.
Such a situation might arise if you have an application
with a scripting interface that is used by importing
stuff from the application's internal libraries.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.pyt
to be free
of Microsoft DRM crap, and I'd be unhappy if I were forced
to downgrade to a later version just so I could use Py3 on
it.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscr
had much experience building
installers using distutils, so I'm not sure
how much of a problem that would be.)
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.o
Glenn Linderman wrote:
In this scenario, the .pyc files would still live in __pycache__ ?
Complete with the foo..pyc naming ?
It might be neater to have a separate cache directory
for each bytecode version, named __cache.__ or
some such.
--
Greg
Glyph Lefkowitz wrote:
if we're going to have it be something.something-else, can we please
make sure that .something-else is a common extension that means
"python bytecode cache"?
Maybe something like
__bytecode-__.pycache
?
--
Greg
___
801 - 900 of 2499 matches
Mail list logo