Skip to content

Idea: make PyObject generic over the Python type? #379

Description

@nelhage

I'm writing some code that relies on storing PyObjects into the graph, and it would be helpful if I could write (e.g.) PyObject[MyClass] to specify "a PyObject which contains this specific type."

The dumbest version would type-erase and just use the annotations for human use when writing code, but of course you could also imagine lifting the types of PyObjects into facts in the graph of some sort and automatically using them for e-matching and otherwise, although that of course adds a lot more complexity.

Thanks for egglog and egglog-python, by the way -- I'm very excited about these projects and finding more places I can use them!

Activity

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