From 9b2d9f990537b8c36c0e3fd936b4ae14b88a59ab Mon Sep 17 00:00:00 2001 From: bnewbold Date: Mon, 4 Apr 2016 18:05:17 -0400 Subject: pyrecwrap: nest python classes as modules This brings the behavior closer to how PyCall's pywrap() itself works, and makes this function useful for PyX. With Python3 and PyX 0.14.1, this generates 1100 nested modules or classes; the previous commit (modules only) had much fewer (167 modules). --- src/pyrecwrap.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/pyrecwrap.jl b/src/pyrecwrap.jl index 7b31e56..9cfc5e4 100644 --- a/src/pyrecwrap.jl +++ b/src/pyrecwrap.jl @@ -30,7 +30,8 @@ function pyrecwrap(o::PyObject, mname::Symbol=:__anon__) _pyrecwrap_cache[o] = m consts = Expr[] for (ms, mo) in members # ms is Symbol, mo is PyObject) - if pyisinstance(mo, PyCall.@pyglobalobj :PyModule_Type) + if pyisinstance(mo, PyCall.@pyglobalobj :PyModule_Type) || + pyisinstance(mo, PyCall.@pyglobalobj :PyType_Type) if mo == PyCall.inspect continue end -- cgit v1.2.3