You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-7Lines changed: 4 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ without copying them.
19
19
## Installation
20
20
21
21
Within Julia, just use the package manager to run `Pkg.add("PyCall")` to
22
-
install the files. Julia 0.4 is required.
22
+
install the files. Julia 0.4 or later is required.
23
23
24
24
The latest development version of PyCall is available from
25
25
<https://github.com/stevengj/PyCall.jl>. If you want to switch to
@@ -159,8 +159,6 @@ Here are solutions to some common problems:
159
159
* As mentioned above, use `foo[:bar]` and `foo[:bar](...)` rather than `foo.bar` and `foo.bar(...)`,
160
160
respectively, to access attributes and methods of Python objects.
161
161
162
-
* In Julia 0.3, sometimes calling a Python function fails because PyCall doesn't realize it is a callable object (since so many types of objects can be callable in Python). The workaround is to use `pycall(foo, PyAny, args...)` instead of `foo(args...)`. If you want to call `foo.bar(args...)` in Python, it is good to use `pycall(foo["bar"], PyAny, args...)`, where using `foo["bar"]` instead of `foo[:bar]` prevents any automatic conversion of the `bar` field. In Julia 0.4, however, this problem goes away: all PyObjects are automatically callable, thanks to call overloading in Julia 0.4.
163
-
164
162
* By default, PyCall [doesn't include the current directory in the Python search path](https://github.com/stevengj/PyCall.jl/issues/48). If you want to do that (in order to load a Python module from the current directory), just run `unshift!(PyVector(pyimport("sys")["path"]), "")`.
165
163
166
164
## Python object interfaces
@@ -203,10 +201,9 @@ key, default)`. Similarly, `set!(o, key, val)` is equivalent to
203
201
o[key]` in Python. For one or more *integer* indices, `o[i]` in Julia
204
202
is equivalent to `o[i-1]` in Python.
205
203
206
-
In Julia 0.4, you can call an `o::PyObject` via `o(args...)` just like
207
-
in Python (assuming that the object is callable in Python). In Julia
208
-
0.3, you have to do `pycall(o, PyAny, args...)`, although the explicit
209
-
`pycall` form is still useful in Julia 0.4 if you want to specify the
204
+
You can call an `o::PyObject` via `o(args...)` just like in Python
205
+
(assuming that the object is callable in Python). The explicit
206
+
`pycall` form is still useful in Julia if you want to specify the
0 commit comments