PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 535 - QtPoint doesn't like numpy int64 type
: QtPoint doesn't like numpy int64 type
Status: CLOSED WONTFIX
Product: PySide
Classification: Unclassified
Component: PySide
: HEAD
: Macintosh Mac OS
: P3 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2010-12-07 15:09 EET by Daniel Ashbrook
Modified: 2010-12-20 11:26 EET (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Ashbrook 2010-12-07 15:09:21 EET
Numpy "casts" Python types to its own; QPointF has no problem with
numpy.float64, but QPoint doesn't like numpy.int64:

from PySide.QtCore import *
from numpy import array
a = array((1,2))
QPoint(a[0], a[1])


TypeError: 'PySide.QtCore.QPoint' called with wrong argument types:
  PySide.QtCore.QPoint(numpy.int64, numpy.int64)
Comment 1 Hugo Parente Lima 2010-12-07 15:20:57 EET
numpy.int64 is not a Python integer type subclass.

We can't add overloads for every library that creates it's own types to
represent numbers, it's just no feasible.

So the better way is to let the user to explicit cast to int before pass it to
QPoint following the Python mantra. Marking as wontfix.
Comment 2 Daniel Ashbrook 2010-12-07 15:32:00 EET
numpy.float64 doesn't appear to be a subclass of float; any idea why it works
but int64 doesn't?
Comment 3 Hugo Parente Lima 2010-12-20 11:26:14 EET
Closign bugs after release of 1.0.0 beta2.