aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2016-04-04 18:05:17 -0400
committerbnewbold <bnewbold@robocracy.org>2016-04-04 18:07:21 -0400
commit9b2d9f990537b8c36c0e3fd936b4ae14b88a59ab (patch)
tree245237f7f5b564ae26828313c70745474eeb4084 /src
parent6ca0769a2f82c7c7d6a34fda2571b9ae15950842 (diff)
downloadPyX.jl-9b2d9f990537b8c36c0e3fd936b4ae14b88a59ab.tar.gz
PyX.jl-9b2d9f990537b8c36c0e3fd936b4ae14b88a59ab.zip
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).
Diffstat (limited to 'src')
-rw-r--r--src/pyrecwrap.jl3
1 files changed, 2 insertions, 1 deletions
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