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

Improve the primitive type conversion rules

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.12.2
    • Shiboken
    • None

    Description

      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)

      Attachments

        Issue Links

          For Gerrit Dashboard: PYSIDE-1000
          # Subject Branch Project Status CR V

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes