Created
August 1, 2020 18:48
-
-
Save brettfazio/e8ab3527d3ea666ce54fb4e05efb9cf9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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