struct Trong Python

from collections import namedtuple

Something = namedtuple("Something", ["x", "y"])
p1 = Point(1, 2)
print(p1)
# gọi attribute
print(p1.x, p1.y)
# gọi theo chỉ số
print(p1[0], p1[1])

# nếu có ý định gán thì error ngay lập tức
p1.x = 2  # lỗi AttributeError: can't set attribute
Fragile Fish