Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1000

Improve the primitive type conversion rules

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P2: Important P2: Important
    • None
    • 5.12.2
    • Shiboken
    • None

      At the moment in shiboken, the isConvertible methods from the primitive types handling seems not to be accurate.

      For example:

      • For Integers, we use the function PyFloat_Check
      • For Floats, we use the function PyInt_Check(pyIn) || PyLong_Check(pyIn)
      • and the same happens with long, bool, etc.

      Also, the complementary methods isOtherConvertible is mainly using SbkNumber_Check which is an alias to PyNumber_Check, function that's too permissive since accept both integers and floats.
      On CPython's HISTORY file (Misc/HISTORY), there is a statement that suggest its deprecation in the future:

      PyNumber_Check() is not very useful to determine numeric behavior.
        It may be deprecated.)
      

      (primitive types code)

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            crmaurei Cristian Maureira-Fredes
            crmaurei Cristian Maureira-Fredes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes