Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dict is not accepting int as key. #193

Open
D-X-Y opened this issue Jul 22, 2023 · 1 comment
Open

Dict is not accepting int as key. #193

D-X-Y opened this issue Jul 22, 2023 · 1 comment

Comments

@D-X-Y
Copy link
Contributor

D-X-Y commented Jul 22, 2023

import pyglove as pg

class A(pg.Object):

  x: Annotated[Dict, "."] = dict()
  y: Annotated[str, "."] = ".."

# Define a simple dictionary
data = A(x={1:1})

Most normal user may expect this code snippet work well?

@daiyip
Copy link
Collaborator

daiyip commented Jul 27, 2023

pg.Dict only support string key at the moment, as it was introduced for managing object hierarchy.
But this is something I also desired, will post once it's supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants