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

Support a Vertex's and Edge's Dictionary Initialization when Creating the Object #70

Open
Paebbels opened this issue Dec 28, 2022 · 0 comments
Labels
Enhancement New feature or request Graph pyTooling.Graph - Graph data structure.
Milestone

Comments

@Paebbels
Copy link
Member

Currently, a graph's vertex and edge objects can't be initialized with dictionary values, when the object is created. After creation, the dictionary indexing syntax can be used to add new key-value pairs.

Old:

v = Vertex()
v["key"] = "value"

Solution 1:
Use named parameters as initial dictionary values.

v = Vertex(..., key="value")

Solution 2:
Add a new named parameter dict for handing over initial dictionary values.

v = Vertex(..., dict={"key":"value"})
@Paebbels Paebbels added Enhancement New feature or request Graph pyTooling.Graph - Graph data structure. labels Dec 28, 2022
@Paebbels Paebbels added this to the v6.0.0 milestone Jan 1, 2024
@Paebbels Paebbels modified the milestones: v6.0.0, v6.1.0 Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Graph pyTooling.Graph - Graph data structure.
Projects
None yet
Development

No branches or pull requests

1 participant