Construct a datetime from a given date and a given time.
(cls, date, time, tzinfo=True)
| 1938 | |
| 1939 | @classmethod |
| 1940 | def combine(cls, date, time, tzinfo=True): |
| 1941 | "Construct a datetime from a given date and a given time." |
| 1942 | if not isinstance(date, _date_class): |
| 1943 | raise TypeError("date argument must be a date instance") |
| 1944 | if not isinstance(time, _time_class): |
| 1945 | raise TypeError("time argument must be a time instance") |
| 1946 | if tzinfo is True: |
| 1947 | tzinfo = time.tzinfo |
| 1948 | return cls(date.year, date.month, date.day, |
| 1949 | time.hour, time.minute, time.second, time.microsecond, |
| 1950 | tzinfo, fold=time.fold) |
| 1951 | |
| 1952 | @classmethod |
| 1953 | def fromisoformat(cls, date_string): |