Skip to content

Conversation

SMoraisAnsys
Copy link
Contributor

This PR is currently a WIP. The changes are:

  • using __getitem__ instead of the get_item method that was implemented. The great thing with that change is that any use can now call speos_client[my_key] instead of speos_client.get_item(key=my_key). It's a good practice to implement magick methods when they make sense.
  • using Python property to propose something simple to our users while hidding the complexity. This way, a user will think he is playing with an attribute when, behind the scene, there is something complexe going on. It is also a good practice in Python.

Note

I used property for the Face class, if the change is accepted, we can think about applying it to all script files

@SMoraisAnsys SMoraisAnsys force-pushed the refactor/use-magick-methods branch from dd414d1 to 8a540d9 Compare February 6, 2025 11:56
@StefanThoene
Copy link
Collaborator

@SMoraisAnsys in regards to the properties: How to combine the properties with the usage of fluent API methodology currently implemented.

in regards for the getitem i didn't know about that magic method. so great idea

@SMoraisAnsys
Copy link
Contributor Author

Closing as superseded by the POC #453

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

Successfully merging this pull request may close these issues.

2 participants