And least favourite?
I really like getpass
and dataclasses
myself. dataclasses
makes class creation so much quicker and easier whilst enforcing type hinting in an easy-to-understand way. It's just a really nice addition to the language. Although getpass
is great too, because it does one small thing very well.
If you don't know dataclasses
look like this:
Regular class:
class Car:
def __init__(self, make: str, model: str):
self.model = model
self.make = make
But the same as a dataclass is just
from dataclasses import dataclass
@dataclass
class Car:
make: str
model: str
And they both work exactly the same! It makes writing classes so much easier, especially when teaching new people about classes.