Because
year
is not a method, it's an attribute (or field). Why did you think year
was a method of the datetime
class? The docs tell you that it's an attribute.