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

Type Hints #199

Open
dinglind opened this issue Jun 17, 2024 · 0 comments
Open

Type Hints #199

dinglind opened this issue Jun 17, 2024 · 0 comments

Comments

@dinglind
Copy link

Is your feature request related to a problem? Please describe.
I think type hints are extremely valuable. I've noticed that there could be better type hints in your code. Would you be interested in this?

Describe the solution you'd like
I can give you an example. Instead of making a dictionary with the type and then popping the dictionary, you can modify the code to allow for type hints. You wouldn't have to pop anything either.

Before:
class FEModel3D():
def init(self):
self.Nodes = {str:Node3D} # A dictionary of the model's nodes
self.Nodes.pop(str)

After:
from typing import Dict

  class FEModel3D():
      def __init__(self):
          self.Nodes: Dict[str, Node3D] = {}          # A dictionary of the model's nodes

Describe alternatives you've considered
See above

Additional context
N/A

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

1 participant