PyNite icon indicating copy to clipboard operation
PyNite copied to clipboard

Type Hints

Open dinglind opened this issue 2 weeks ago • 0 comments

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

dinglind avatar Jun 17 '24 17:06 dinglind