"vscode:/vscode.git/clone" did not exist on "fab02efb10d5d3a057eba85752b91d1d77bfcd4b"
  1. 19 Sep, 2016 1 commit
  2. 10 Sep, 2016 2 commits
  3. 09 Sep, 2016 1 commit
    • Jason Rhinelander's avatar
      Implement py::init_alias<>() constructors · ec62d977
      Jason Rhinelander authored
      This commit adds support for forcing alias type initialization by
      defining constructors with `py::init_alias<arg1, arg2>()` instead of
      `py::init<arg1, arg2>()`.  Currently py::init<> only results in Alias
      initialization if the type is extended in python, or the given
      arguments can't be used to construct the base type, but can be used to
      construct the alias.  py::init_alias<>, in contrast, always invokes the
      constructor of the alias type.
      
      It looks like this was already the intention of
      `py::detail::init_alias`, which was forward-declared in
      86d825f3, but was apparently never
      finished: despite the existance of a .def method accepting it, the
      `detail::init_alias` class isn't actually defined anywhere.
      
      This commit completes the feature (or possibly repurposes it), allowing
      declaration of classes that will always initialize the trampoline which
      is (as I argued in #397) sometimes useful.
      ec62d977
  4. 08 Sep, 2016 1 commit
    • Jason Rhinelander's avatar
      Fix type alias initialization · 9c6859ee
      Jason Rhinelander authored
      Type alias for alias classes with members didn't work properly: space
      was only allocated for sizeof(type), but if we want to be able to put a
      type_alias instance there, we need sizeof(type_alias), but
      sizeof(type_alias) > sizeof(type) whenever type_alias has members.
      9c6859ee
  5. 07 Sep, 2016 2 commits
    • Jason Rhinelander's avatar
      Fail static_assert when trying to reference non-referencable types · c03db9ba
      Jason Rhinelander authored
      The previous commit to address #392 triggers a compiler warning about
      returning a reference to a local variable, which is *not* a false alarm:
      the following:
      
          py::cast<int &>(o)
      
      (which happens internally in an overload declaration) really is
      returning a reference to a local, because the cast operators for the
      type_caster for numeric types returns a reference to its own member.
      
      This commit adds a static_assert to make that a compilation failure
      rather than returning a reference into about-to-be-freed memory.
      
      Incidentally, this is also a fix for #219, which is exactly the same
      issue: we can't reference numeric primitives that are cast from
      wrappers around python numeric types.
      c03db9ba
    • Jason Rhinelander's avatar
      Fix type caster for heap reference types · 56f71775
      Jason Rhinelander authored
      Need to use the intrinsic type, not the raw type.
      
      Fixes #392.
      56f71775
  6. 06 Sep, 2016 1 commit
  7. 19 Aug, 2016 3 commits
    • Dean Moldovan's avatar
      99dbdc16
    • Dean Moldovan's avatar
      Simplify tests by replacing output capture with asserts where possible · 665e8804
      Dean Moldovan authored
      The C++ part of the test code is modified to achieve this. As a result,
      this kind of test:
      
      ```python
      with capture:
          kw_func1(5, y=10)
      assert capture == "kw_func(x=5, y=10)"
      ```
      
      can be replaced with a simple:
      
      `assert kw_func1(5, y=10) == "x=5, y=10"`
      665e8804
    • Dean Moldovan's avatar
      Port tests to pytest · a0c1ccf0
      Dean Moldovan authored
      Use simple asserts and pytest's powerful introspection to make testing
      simpler. This merges the old .py/.ref file pairs into simple .py files
      where the expected values are right next to the code being tested.
      
      This commit does not touch the C++ part of the code and replicates the
      Python tests exactly like the old .ref-file-based approach.
      a0c1ccf0