Merge pull request #3 from bwllc/WIP

Update gcodes.py
This commit is contained in:
engrenage 2024-03-08 12:40:30 +01:00 committed by GitHub
commit 0578fa5d81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -211,6 +211,14 @@ class GCode(object):
parameters=param_str,
)
def __hash__(self):
"""Hash representation of the gcode, for set and dictionary usage"""
try:
return hash(self.word_key)
except TypeError:
return hash(self.word_letter) # May also want to retrieve additional value info
def _default_word(self):
if self.default_word:
return copy(self.default_word)