PyCall question


#1

It seems that PyCall does not support class methods? e.g.

julia> using PyCall

julia> @pyimport datetime

julia> datetime.date(2018,1,1)
2018-01-01

julia> datetime.date.today()
ERROR: type PyObject has no field today

Ref: https://docs.python.org/3.6/library/datetime.html#datetime.date


#2

From the README:

Important: The biggest difference from Python is that object attributes/members are accessed with o[:attribute] rather than o.attribute, so that o.method(...) in Python is replaced by o[:method](...) in Julia.

Try datetime.date[:today]() and see if that works.


#3

If PyCall overloads getfield in v0.7, that would really cool since pieces of code and tutorials can then be copied over from Python to Julia with few changes.


#4

It will.