Skip to content

Julia object has no attribute Any #144

Closed

Description

@zekeriyasari

Although it is possible to access any built-in Julia function, it is not possible to access any of the Julia built-in Julia types. For example, the script

from julia import Julia
jul = Julia()
print(jul.sind)
print(jul.Any)

gives the output:

<PyCall.jlwrap sind>
Traceback (most recent call last):
  File "/user/zekeriya.sari/Documents/AtomProjects/PyJUlia/test.py", line 5, in <module>
    print(jul.Any)
AttributeError: 'Julia' object has no attribute 'Any'

I did not see any information about this issue in the documentation and in the test codes of pyjulia. I wonder if it is possible to access these built-in Julia types in python side. (See JuliaPy/PyCall.jl#460). Any suggestions?

Activity

  1. stevengj commented on Jan 18, 2018

    @stevengj
    Member

    Yes, it looks like it currently only exports the functions in Base (https://github.com/JuliaPy/pyjulia/blob/master/julia/core.py#L386), and similarly for other modules.

    Honestly, the whole current approach seems less than ideal to me… I feel like it should load symbols in the module(s) lazily, rather than adding them all as attributes when the module is loaded. This would improve load times and also be more flexible about non-function symbols (e.g. mutable globals would work, because the conversion would occur each time they are accessed).

    For now, you can presumably do jul.eval("Any")?

  2. zekeriyasari commented on Jan 18, 2018

    @zekeriyasari
    Author

    jul.eval("Any") works fine. Thank you for all.

  3. added 3 commits that reference this issue on May 16, 2018
    27659b0
    baec81a
    b30af45
  4. added a commit that references this issue on Jun 20, 2018
    155a1d1
  5. added a commit that references this issue on Jul 31, 2018
    d7c3fb0
  6. added a commit that references this issue on Dec 28, 2024
    e617ad9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions