Add type hint to variable mask

Viewed 151

I've just started with Python (v.3.7.7) and with PyCharm.

With this code:

class NiftiImages:
    def __init__(self):
        self.brain = None
        self.mask = None

PyCharm suggest me to "Add type hint to variable 'mask'. And if I hit it, I get this:

class NiftiImages:
    mask: None

    def __init__(self):
        self.brain = None
        self.mask = None

brain and mask will always be Numpy Array.

What is a type hint for a variable (in this case for a Numpy Array)?

0 Answers
Related