cliburn/sta-663-2016

vectorize example for pybind11 shadows builtin python module

Closed this issue · 2 comments

Don't see 18G in this repository, but in case others hit this issue, I found that:

PYBIND11_PLUGIN(code) {
pybind11::module m("code", "auto-compiled c++ extension");
m.def("square", py::vectorize(square));
return m.ptr();
}

failed because it shadows:

In [1]: import code

In [2]: print(code.file)
/Users/phil/mini35/envs/py36/lib/python3.6/code.py

Fix -- rename module to pycode

thanks for the great set of notes

Thank you - 18G is not in the repository so I am closing. The version for this year is at https://github.com/cliburn/sta-663-2017. Please post any issues you find to that repo as this one is for last year's class and will not be updated.

I see the new lecture 12 substitutes code->wrap, so problem solved

just a heads-up that a google search on:

pybind11 numpy example

returns 2016-18G as the third hit -- perhaps put in a redirect to 2017?