[Python-Dev] [patch] fpconst for python3

Michael Foord fuzzyman at voidspace.org.uk
Wed Oct 20 18:50:52 CEST 2010


  On 20/10/2010 17:43, David Malcolm wrote:
> (my apologies, if necessary, for top-posting)
>
> FWIW Neal asked about this on Fedora's development mailing list as well:
> http://lists.fedoraproject.org/pipermail/devel/2010-October/144535.html
>
> If I'm reading:
>    http://pypi.python.org/pypi/fpconst/
> correctly, that project hasn't had an upstream update in over four
> years, and the upstream home page seems to be down.
>
> I believe that there are a number of python 2 modules that are either
> mature or "good enough", but need porting to work with python 3, and in
> some of these cases, upstream may have either disappeared, or lost
> interest.
>
> I'm guessing that Neal has already made an effort to contact the
> maintainer of fpconst.
>
> IIRC, fpconst is a relatively simple module, and the fixes to port to
> python 3 seem simple.
>
> So IMHO this is on-topic for python.org (if not necessarily this list),
> in that we have an interest in timely porting of Python 2 code to Python
> 3, and there has been discussion here on how to encourage people to port
> their code.
>
> We don't want each Linux distribution to do different patches to port
> the code to Python 3: there ought to be some kind of clearing-house for
> this kind of simple porting, so that python 3 stacks will work
> consistently across the different distributions.
>
> Whether or not that's python-dev, I'm not sure. Perhaps:
>    http://mail.python.org/mailman/listinfo/python-porting
> is a better list.
>
> FWIW you can see the current status of Python 3 porting within Fedora
> here:
>    https://fedoraproject.org/wiki/Python3#Porting_status

Wow, that's very interesting. Whilst a lot of people on this list will 
have an interest in knowing about this it still isn't the right list for 
discussing it. The python-porting list *is* an entirely appropriate list 
and it would be great to see more traffic there.

What to do about "abandoned" PyPI packages that are still used, and 
defacto maintained by downstream packagers, is another 
(interesting/important/difficult) topic that is also off-topic for this 
list. catalog-sig is possibly the right place for that. Creating a new 
PyPI package for the port and forking the project is probably the best 
approach.

Michael Foord

> Hope this is helpful
> Dave
>
> On Tue, 2010-10-19 at 20:07 -0500, Benjamin Peterson wrote:
>> fpconst developers?
>>
>> 2010/10/19 Neal Becker<ndbecker2 at gmail.com>:
>>> Where should I send this patch?
>>>
>>> diff -u fpconst-0.7.2/fpconst.py fpconst-0.7.2.new/fpconst.py
>>> --- fpconst-0.7.2/fpconst.py    2005-02-24 12:42:03.000000000 -0500
>>> +++ fpconst-0.7.2.new/fpconst.py        2010-10-19 20:55:07.407765664 -0400
>>> @@ -40,18 +40,18 @@
>>>   ident = "$Id: fpconst.py,v 1.16 2005/02/24 17:42:03 warnes Exp $"
>>>
>>>   import struct, operator
>>> +from functools import reduce
>>>
>>>   # check endianess
>>> -_big_endian = struct.pack('i',1)[0] != '\x01'
>>> -
>>> +_big_endian = struct.pack('i',1)[0] != 1
>>>   # and define appropriate constants
>>>   if(_big_endian):
>>> -    NaN    = struct.unpack('d', '\x7F\xF8\x00\x00\x00\x00\x00\x00')[0]
>>> -    PosInf = struct.unpack('d', '\x7F\xF0\x00\x00\x00\x00\x00\x00')[0]
>>> +    NaN    = struct.unpack('d', b'\x7F\xF8\x00\x00\x00\x00\x00\x00')[0]
>>> +    PosInf = struct.unpack('d', b'\x7F\xF0\x00\x00\x00\x00\x00\x00')[0]
>>>      NegInf = -PosInf
>>>   else:
>>> -    NaN    = struct.unpack('d', '\x00\x00\x00\x00\x00\x00\xf8\xff')[0]
>>> -    PosInf = struct.unpack('d', '\x00\x00\x00\x00\x00\x00\xf0\x7f')[0]
>>> +    NaN    = struct.unpack('d', b'\x00\x00\x00\x00\x00\x00\xf8\xff')[0]
>>> +    PosInf = struct.unpack('d', b'\x00\x00\x00\x00\x00\x00\xf0\x7f')[0]
>>>      NegInf = -PosInf
>>>
>>>   def _double_as_bytes(dval):
>>>
>>> _______________________________________________
>>> Python-Dev mailing list
>>> Python-Dev at python.org
>>> http://mail.python.org/mailman/listinfo/python-dev
>>> Unsubscribe: http://mail.python.org/mailman/options/python-dev/benjamin%40python.org
>>>
>>
>>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.uk


-- 

http://www.voidspace.org.uk/

READ CAREFULLY. By accepting and reading this email you agree,
on behalf of your employer, to release me from all obligations
and waivers arising from any and all NON-NEGOTIATED agreements,
licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap,
confidentiality, non-disclosure, non-compete and acceptable use
policies (”BOGUS AGREEMENTS”) that I have entered into with your
employer, its partners, licensors, agents and assigns, in
perpetuity, without prejudice to my ongoing rights and privileges.
You further represent that you have the authority to release me
from any BOGUS AGREEMENTS on behalf of your employer.



More information about the Python-Dev mailing list