code: def from_date(cls, date):
          
          try:
              date = date.date()
          except AttributeError:
              pass
          return cls(date.year, date.month)
docs: Returns a Month instance from the given datetime.date or
          datetime.datetime object