Commit e617ad9
Make module loading lazy (#162)
* Make module loading lazy
* Catch less in JuliaModule.__getattr__
* Support star import
* Special handling for Main module
It adds an easier way to set variables in Julia's global namespace:
>>> from julia import Main
>>> Main.xs = [1, 2, 3]
* Deprecate Julia.__getattr__ (and make it lazy)
fixes #144
* Initialize Julia in JuliaModuleLoader if required
This makes `from julia import <Julia module>` works without the initial
setup. Note that a custom setup can still be done by calling
`julia.Julia` with appropriate arguments *before* trying to import Julia
modules.
closes #39, #79
* More interfaces to JuliaMainModule
* Document the new API
* Properly remove prefix
* Fix JuliaModule.__all__; add .__dir__
* Cache original os.environ for tests
* Simplify JuliaModule.__try_getattr
* Add LegacyJulia to break infinite recursion
* Don't import in isamodule
Otherwise, trying to access undefined variables such as
`julia.Base.__path__` produces a warning from Julia before
`JuliaModule.__getattr__` raising `AttributeError`.
* Remove core._orig_env; it can be done in test code
* Use Enums as example sub-module
as Base.REPL was pulled out from Base in Julia 0.7.
* More import tests
* Remove noop code
* Fix wording1 parent 779808b commit e617ad9
File tree
5 files changed
+278
-104
lines changed- julia
- test
5 files changed
+278
-104
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
62 | 76 | | |
63 | 77 | | |
64 | | - | |
| 78 | + | |
65 | 79 | | |
66 | 80 | | |
67 | | - | |
| 81 | + | |
68 | 82 | | |
69 | 83 | | |
70 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
71 | 87 | | |
72 | 88 | | |
73 | | - | |
| 89 | + | |
| 90 | + | |
74 | 91 | | |
75 | 92 | | |
76 | | - | |
| 93 | + | |
77 | 94 | | |
78 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
79 | 127 | | |
80 | 128 | | |
81 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments