Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
a2a6cccf
Commit
a2a6cccf
authored
Mar 09, 2017
by
Syrtis Major
Committed by
GitHub
Mar 09, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1 from syrte/magic_import_all
IPython magic only import things in `"__all__"`
parents
af4737d7
cf14c484
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
Cython/Build/IpythonMagic.py
Cython/Build/IpythonMagic.py
+11
-3
No files found.
Cython/Build/IpythonMagic.py
View file @
a2a6cccf
...
@@ -93,9 +93,17 @@ class CythonMagics(Magics):
...
@@ -93,9 +93,17 @@ class CythonMagics(Magics):
self
.
_pyximport_installed
=
False
self
.
_pyximport_installed
=
False
def
_import_all
(
self
,
module
):
def
_import_all
(
self
,
module
):
for
k
,
v
in
module
.
__dict__
.
items
():
mdict
=
module
.
__dict__
if
not
k
.
startswith
(
'__'
):
if
'__all__'
in
mdict
:
self
.
shell
.
push
({
k
:
v
})
for
k
in
mdict
[
'__all__'
]:
if
k
in
mdict
:
self
.
shell
.
push
({
k
:
mdict
[
k
]})
else
:
raise
AttributeError
(
"'module' object has no attribute '%s'"
%
k
)
else
:
for
k
,
v
in
mdict
.
items
():
if
not
k
.
startswith
(
'__'
):
self
.
shell
.
push
({
k
:
v
})
@
cell_magic
@
cell_magic
def
cython_inline
(
self
,
line
,
cell
):
def
cython_inline
(
self
,
line
,
cell
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment