1. 25 Oct, 2016 1 commit
    • Jason Rhinelander's avatar
      Prevent overwriting previous declarations · 6873c202
      Jason Rhinelander authored
      Currently pybind11 doesn't check when you define a new object (e.g. a
      class, function, or exception) that overwrites an existing one.  If the
      thing being overwritten is a class, this leads to a segfault (because
      pybind still thinks the type is defined, even though Python no longer
      has the type).  In other cases this is harmless (e.g. replacing a
      function with an exception), but even in that case it's most likely a
      bug.
      
      This code doesn't prevent you from actively doing something harmful,
      like deliberately overwriting a previous definition, but detects
      overwriting with a run-time error if it occurs in the standard
      class/function/exception/def registration interfaces.
      
      All of the additions are in non-template code; the result is actually a
      tiny decrease in .so size compared to master without the new test code
      (977304 to 977272 bytes), and about 4K higher with the new tests.
      6873c202
  2. 24 Oct, 2016 3 commits
  3. 23 Oct, 2016 1 commit
  4. 22 Oct, 2016 8 commits
  5. 21 Oct, 2016 1 commit
  6. 20 Oct, 2016 17 commits
  7. 17 Oct, 2016 2 commits
  8. 16 Oct, 2016 2 commits
    • Wenzel Jakob's avatar
      Merge pull request #449 from jagerman/no-implicit-conversions · 135fd149
      Wenzel Jakob authored
      Disable most implicit conversion constructors
      135fd149
    • Jason Rhinelander's avatar
      Disable most implicit conversion constructors · 12d76600
      Jason Rhinelander authored
      We have various classes that have non-explicit constructors that accept
      a single argument, which is implicitly making them implicitly
      convertible from the argument.  In a few cases, this is desirable (e.g.
      implicit conversion of std::string to py::str, or conversion of double
      to py::float_); in many others, however, it is unintended (e.g. implicit
      conversion of size_t to some pre-declared py::array_t<T> type).
      
      This disables most of the unwanted implicit conversions by marking them
      `explicit`, and comments the ones that are deliberately left implicit.
      12d76600
  9. 15 Oct, 2016 2 commits
  10. 14 Oct, 2016 3 commits