Skip to content

Make ArrayValue not callable #728

Description

@JamesWrigley

Some Python libraries can accept either a function or array, and distinguish between the two with isinstance(x, typing.Callable). Unfortunately this is always the case for ArrayValue:
Image

Which means that libraries may try to treat the array as a function. Would it be possible to fix that? I'd guess that ArrayValue would need to stop inheriting from AnyValue, which defines __call__().

Activity

  1. cjdoris commented on Dec 1, 2025

    @cjdoris
    Member

    Unfortunately that would be a breaking change, because it's documented to inherit from AnyValue.

    However I think this is fixed on the v1 branch. AFAIR Jl (what was AnyValue) and JlArray (what was ArrayValue) now both inherit from JlBase, which has very little functionality, and only Jl has __call__.

    Please try it out and report back.

  2. JamesWrigley commented on Dec 3, 2025

    @JamesWrigley
    ContributorAuthor

    Thanks, indeed it's fixed on v1. Unfortunately v1 somehow breaks the real example, but that's probably a different issue :)

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions