Skip to content

Commit 414542f

Browse files
Merge pull request mavlink#397 from mattes-bru/fixed-compare-operators-in-template
renamed the equals function to make structs compareable by == operator
2 parents 5e9d69c + ebc9337 commit 414542f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

other/templates/py/struct.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class {{ name.upper_camel_case }}:
2424
self.{{ field.name.lower_snake_case }} = {{ field.name.lower_snake_case }}
2525
{%- endfor %}
2626

27-
def __equals__(self, to_compare):
27+
def __eq__(self, to_compare):
2828
""" Checks if two {{ name.upper_camel_case }} are the same """
2929
try:
3030
# Try to compare - this likely fails when it is compared to a non

0 commit comments

Comments
 (0)