PyCall question

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

julia> using PyCall

julia> @pyimport datetime


ERROR: type PyObject has no field today

Ref: 8.1. datetime — Basic date and time types — Python 3.6.15 documentation

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[:today]() and see if that works.

1 Like

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.

It will.