Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-9814

Investigate pybind11 base class data member exposure from derived

    Details

    • Type: Story
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Templates:
    • Story Points:
      1
    • Sprint:
      DRP F17-1, DRP F17-2, DRP F17-3, DRP F17-4, DRP F17-5
    • Team:
      Data Release Production

      Description

      On 14-03-2017, John Parejko reported on Slack that when a base class B has a data member x and a derived class D attempts to expose this data member using clsB.def_readonly("x", &D::x); (because B should not itself be wrapped), an error is thrown:

      (Pdb) d.x
      *** TypeError: (): incompatible function arguments. The following argument types are supported:
          1. (self: B) -> float
       
      Invoked with: <D object at 0x7f451da33ea0>
      

      It was later discovered that casting explicitly to a D member pointer (e.g. clsD.def_readonly("x", (float &D::*) &D::x);) does work. So something must be going wrong in the type deduction of def_readonly.

      Investigate and report upstream.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                pschella Pim Schellart [X] (Inactive)
                Watchers:
                Pim Schellart [X] (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Summary Panel