[issue16899] Add support for C99 complex type (_Complex) as ctypes.c_complex

2017-01-21 Thread Tom Krauss

Tom Krauss added the comment:

I'm trying to add support for this in cffi, which uses ctypes... apparently 
this is now supported in libffi (https://github.com/libffi/libffi, v3.2 Nov 
2014). 
It would be nice if this issue could be re-opened, or another one created for 
the same purpose.

--
nosy: +Tom Krauss

___
Python tracker 
<http://bugs.python.org/issue16899>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-19 Thread Tom Krauss

New submission from Tom Krauss:

Consider the following simple class that provides a "__complex__" method.

class C(object):
  def __init__(self, x):
 self.x = x
  def __complex__(self):
return self.x

x=C(-0j)

PYTHON 2.7.13
>>> x.x
-0j
>>> complex(x)
0j

PYTHON 3.6
>>> x.x
(-0-0j)
>>> complex(x)
(-0+0j)

--
messages: 288177
nosy: Tom Krauss
priority: normal
severity: normal
status: open
title: complex() on object with __complex__ function loses sign of zero 
imaginary part
type: behavior
versions: Python 2.7, Python 3.6

___
Python tracker 
<http://bugs.python.org/issue29602>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com