Skip to content

Polymake: Better syntax to call functions with <template arguments> #27861

@mkoeppe

Description

@mkoeppe

Currently we have to write:

sage: polymake("tropical::uniform_linear_space<Max>(3,2)")

or

sage: getattr(polymake, "tropical::uniform_linear_space<Max>")(3, 2)

or

sage: polymake.function_call("tropical::uniform_linear_space<Max>", [3, 2])

because the template brackets cannot become part of the Python function name, so the normal . syntax cannot work.

(Also, but not the point of this ticket - #27736: Polymake: Turn polymake applications into objects with directories.)

Also,

    polymake("tropical::uniform_linear_space<Max>")(3,2)

does not work. It looks for an overloaded function without arguments, which fails:

    TypeError: no matching overloaded instance of Polymake::tropical::uniform_linear_space<Max>()

Also,

sage: polymake.call("tropical::uniform_linear_space<Max>", 3, 2)

does not work -- the undocumented and untested call method passes the args tuple to function_call, which expects lists instead of tuples.

CC: @simon-king-jena @jplab @dimpase

Component: packages: experimental

Issue created by migration from https://trac.sagemath.org/ticket/27861

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions