Hello,
I would like to re-raise the issue of float repr() -- making repr(1.1)
== '1.1' instead of '1.1001'.
My use case is data manipulation in the interactive shell - an
extremely powerful tool which, it seems, not so many people use. Many
times I have float data. I think that you'll
> I would like to re-raise the issue of float repr() -- making repr(1.1)
> == '1.1' instead of '1.1001'.
Can you propose an algorithm that meets your needs, and still has the
property of unambiguously identifying the true floating point number?
It's (perhaps) easy to request this, but
"Noam Raphael" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| My use case is data manipulation in the interactive shell -
When doing things other than add and subtract, one soon gets floats that
are no longer such 'even' decimals, even if the input is.
| Many times I have float
Dnia 09-12-2007, N o godzinie 10:33 +0200, Noam Raphael pisze:
> I think that the reason for the long representation is that it uses a
> simple algorithm that makes "eval(repr(f)) == f" always true. However,
> why not use another, a bit more complex, algorithm, which will still
> preserve "eval(re
Terry Reedy schrieb:
> "Noam Raphael" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> | My use case is data manipulation in the interactive shell -
You could always override sys.displayhook in order to handle floats
differently.
> It seems your real problem is that repr() rather
Phillip J. Eby wrote:
> Thinking that they can, and actually producing a tested
> implementation of one that does not, in fact, conflict with the
> implementation of the other, are two different things.
>
> My concern is that I doubt that you can implement the post-import
> hook without in the
Great! He also provides C code, in
http://www.cs.indiana.edu/~burger/fp/index.html
The license says: "All software (c) 1996 Robert G. Burger. Permission
is hereby granted, free of charge, to any person obtaining a copy of
this software, to deal in the software without restriction, including
withou
> Great! He also provides C code, in
> http://www.cs.indiana.edu/~burger/fp/index.html
FWIW: http://labix.org/python-nicefloat
--
Gustavo Niemeyer
http://niemeyer.net
___
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/l
Is the freeze for 3.0a2 still in place? I have a trivial docstring fix for
bytesobject.c.
Skip
___
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/p
[EMAIL PROTECTED] wrote:
> Is the freeze for 3.0a2 still in place? I have a trivial docstring fix for
> bytesobject.c.
The 3.0a2 release is out and the branch is open again.
Christian
___
Python-3000 mailing list
[email protected]
http://mail.pyth
>From http://ivory.idyll.org/blog/dec-07/conversions.html:
class X:
internal = [5,6,7,8]
def __getitem__(self, i):
return self.internal[i]
x = X()
l = [1,2,3]
print l + x
fails with
TypeError: can only concatenate list (not "instance") to list
I tried:
class X(list):
interna
I posted a patch (http://bugs.python.org/issue1677872) a while ago to
add support for reverse iteration through text files - i.e. making
this work:
for line in reversed(open(path)):
print line
It steps through the file backwards a line at a time, without reading
the entire f
-- Forwarded message --
From: Guilherme Polo <[EMAIL PROTECTED]>
Date: 09/12/2007 19:45
Subject: Re: [Python-3000] Possible Duck Typing Problem in Python 2.5?
To: hashcollision <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
2007/12/9, hashcollision <[EMAIL PROTECTED]>:
> From http://ivory.
On Dec 9, 2007 3:21 PM, hashcollision <[EMAIL PROTECTED]> wrote:
> From http://ivory.idyll.org/blog/dec-07/conversions.html:
>
> class X:
> internal = [5,6,7,8]
> def __getitem__(self, i):
> return self.internal[i]
>
> x = X()
>
> l = [1,2,3]
> print l + x
>
> fails with
>
> TypeEr
hashcollision wrote:
> TypeError: can only concatenate list (not "instance") to list
>
> IMHO, this is a problem. Is it? If so, I suggest that it be fixed in python
> 3000.
I seem to remember this came up before, and was considered
not to be something that needed changing.
How would you decide
On 12/9/07, Christian Heimes <[EMAIL PROTECTED]> wrote:
> The touch points between post import hooks and lazy imports
> are minimal.
Could you give me a use-case for post-import hooks *without* lazy imports?
As nearly as I can tell, either
(1) The module is already loaded (and the whole infras
Jim Jewett wrote:
> Could you give me a use-case for post-import hooks *without* lazy imports?
This thread was started with perfect valid and good use case. We want to
apply ABCs to classes of optional modules like decimal and array without
loading the module or modifying the module.
@imp.impo
On 12/9/07, Christian Heimes <[EMAIL PROTECTED]> wrote:
> Jim Jewett wrote:
> > Could you give me a use-case for post-import hooks *without* lazy imports?
> This thread was started with perfect valid and good use case. We want to
> apply ABCs to classes of optional modules like decimal and array w
"Georg Brandl" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| Terry Reedy schrieb:
| > It seems your real problem is that repr() rather than str() is applied
| > within collections. (I am not sure exactly why but suspect there is a
| > reason.)
|
| Consider ["1, 2, 3"].
OK, but t
Mark Russell wrote:
> I posted a patch (http://bugs.python.org/issue1677872) a while ago to
> add support for reverse iteration through text files - i.e. making
> this work:
>
> for line in reversed(open(path)):
> print line
If this involves hacking reversed() to give it speci
it doesn't. read the patch. it adds a __reversed__ method.
http://bugs.python.org/file8902/reverse-file-iterator-20071209.diff
On 12/9/07, Greg Ewing <[EMAIL PROTECTED]> wrote:
>
> Mark Russell wrote:
> > I posted a patch (http://bugs.python.org/issue1677872) a while
for line in reversed(open(path)):
> > print line
>
> If this involves hacking reversed() to give it special
> knowledge of files, I'm not sure it's the best place
> to put it.
It adds a method __reversed__() to class io.TextIOWrapper:
http://bugs.python.org/fi
22 matches
Mail list logo