Skip to content

Instantly share code, notes, and snippets.

@brettfazio
Created August 1, 2020 18:48
Show Gist options
  • Select an option

  • Save brettfazio/e8ab3527d3ea666ce54fb4e05efb9cf9 to your computer and use it in GitHub Desktop.

Select an option

Save brettfazio/e8ab3527d3ea666ce54fb4e05efb9cf9 to your computer and use it in GitHub Desktop.
from dataclasses import dataclass
# Define dataclass
@dataclass
class Vector3D:
x: int
y: int
z: int
# Create a vector
u = Vector3D(1,1,-1)
# Outputs: Vector3D(x=1, y=1, z=-1)
print(u)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment