A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-April/052606.html below:

[Python-Dev] Re: Re: marshal

[Python-Dev] Re: Re: marshal / unmarshal [Python-Dev] Re: Re: marshal / unmarshalFredrik Lundh fredrik at pythonware.com
Sat Apr 9 14:53:15 CEST 2005
Skip Montanaro wrote:

> Are float("inf") and float("nan") supported everywhere?

nope.

>>> float("inf")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: invalid literal for float(): inf
>>> float("nan")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: invalid literal for float(): nan

>>> 1e10000
1.#INF
>>> float("1.#INF")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: invalid literal for float(): 1.#INF

> As a starting point can it be agreed on whether they should be supported?

that would be nice.

> In either case, we should then know how to fix marshal.loads (and probably
> pickle.loads).

pickle doesn't have the INF=>1.0 bug:

>>> import pickle
>>> pickle.loads(pickle.dumps(1e10000))
...
ValueError: invalid literal for float(): 1.#INF

>>> import cPickle
>>> cPickle.loads(cPickle.dumps(1e10000))
...
ValueError: could not convert string to float

>>> import marshal
>>> marshal.loads(marshal.dumps(1e10000))
1.0

</F> 



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4