1. 17 Mar, 2017 1 commit
    • Jason Rhinelander's avatar
      Fail to compile with MI via class_ ctor parameters · b961626c
      Jason Rhinelander authored
      We can't support this for classes from imported modules (which is the
      primary purpose of a ctor argument base class) because we *have* to
      have both parent and derived to properly extract a multiple-inheritance
      base class pointer from a derived class pointer.
      
      We could support this for actual `class_<Base, ...> instances, but since
      in that case the `Base` is already present in the code, it seems more
      consistent to simply always require MI to go via template options.
      b961626c
  2. 23 Feb, 2017 2 commits
    • Dean Moldovan's avatar
      Enable static properties (py::metaclass) by default · dd01665e
      Dean Moldovan authored
      Now that only one shared metaclass is ever allocated, it's extremely
      cheap to enable it for all pybind11 types.
      
      * Deprecate the default py::metaclass() since it's not needed anymore.
      * Allow users to specify a custom metaclass via py::metaclass(handle).
      dd01665e
    • Dean Moldovan's avatar
      Make all classes with the same instance size derive from a common base · 08cbe8df
      Dean Moldovan authored
      In order to fully satisfy Python's inheritance type layout requirements,
      all types should have a common 'solid' base. A solid base is one which
      has the same instance size as the derived type (not counting the space
      required for the optional `dict_ptr` and `weakrefs_ptr`). Thus, `object`
      does not qualify as a solid base for pybind11 types and this can lead to
      issues with multiple inheritance.
      
      To get around this, new base types are created: one per unique instance
      size. There is going to be very few of these bases. They ensure Python's
      MRO checks will pass when multiple bases are involved.
      08cbe8df
  3. 16 Dec, 2016 1 commit
    • Wenzel Jakob's avatar
      WIP: PyPy support (#527) · 1d1f81b2
      Wenzel Jakob authored
      This commit includes modifications that are needed to get pybind11 to work with PyPy. The full test suite compiles and runs except for a last few functions that are commented out (due to problems in PyPy that were reported on the PyPy bugtracker).
      
      Two somewhat intrusive changes were needed to make it possible: two new tags ``py::buffer_protocol()`` and ``py::metaclass()`` must now be specified to the ``class_`` constructor if the class uses the buffer protocol and/or requires a metaclass (e.g. for static properties).
      
      Note that this is only for the PyPy version based on Python 2.7 for now. When the PyPy 3.x has caught up in terms of cpyext compliance, a PyPy 3.x patch will follow.
      1d1f81b2
  4. 20 Oct, 2016 1 commit
    • Dean Moldovan's avatar
      Support std::shared_ptr holder type out of the box · 5d28dd11
      Dean Moldovan authored
      With this there is no more need for manual user declarations like
      `PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)`. Existing ones
      will still compile without error -- they will just be ignored silently.
      
      Resolves #446.
      5d28dd11
  5. 19 Sep, 2016 1 commit