In my attempt to create a class dots
with the fields n
and xy
as shown below:
from dataclasses import dataclass
@dataclass
class dots:
n: int = 200
xy: List[int] = field(default_factory=list)
I am constantly getting the error :
NameError: name 'field' is not defined
Any ideas on how to fix it?
My operating system is Ubuntu 18.04.3 LTS, and the kernel version 4.15.0-58-generic. I am using Python 3.6.4