Time with time zone. Constructors: __new__() strptime() Operators: __repr__, __str__ __eq__, __le__, __lt__, __ge__, __gt__, __hash__ Methods: strftime() isoformat() utcoffset() tzname() dst() Properties (readonly): hour, minute, second,
| 1397 | _tzinfo_class = tzinfo |
| 1398 | |
| 1399 | class time: |
| 1400 | """Time with time zone. |
| 1401 | |
| 1402 | Constructors: |
| 1403 | |
| 1404 | __new__() |
| 1405 | strptime() |
| 1406 | |
| 1407 | Operators: |
| 1408 | |
| 1409 | __repr__, __str__ |
| 1410 | __eq__, __le__, __lt__, __ge__, __gt__, __hash__ |
| 1411 | |
| 1412 | Methods: |
| 1413 | |
| 1414 | strftime() |
| 1415 | isoformat() |
| 1416 | utcoffset() |
| 1417 | tzname() |
| 1418 | dst() |
| 1419 | |
| 1420 | Properties (readonly): |
| 1421 | hour, minute, second, microsecond, tzinfo, fold |
| 1422 | """ |
| 1423 | __slots__ = '_hour', '_minute', '_second', '_microsecond', '_tzinfo', '_hashcode', '_fold' |
| 1424 | |
| 1425 | def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0): |
| 1426 | """Constructor. |
| 1427 | |
| 1428 | Arguments: |
| 1429 | |
| 1430 | hour, minute (required) |
| 1431 | second, microsecond (default to zero) |
| 1432 | tzinfo (default to None) |
| 1433 | fold (keyword only, default to zero) |
| 1434 | """ |
| 1435 | if (isinstance(hour, (bytes, str)) and len(hour) == 6 and |
| 1436 | ord(hour[0:1])&0x7F < 24): |
| 1437 | # Pickle support |
| 1438 | if isinstance(hour, str): |
| 1439 | try: |
| 1440 | hour = hour.encode('latin1') |
| 1441 | except UnicodeEncodeError: |
| 1442 | # More informative error message. |
| 1443 | raise ValueError( |
| 1444 | "Failed to encode latin1 string when unpickling " |
| 1445 | "a time object. " |
| 1446 | "pickle.load(data, encoding='latin1') is assumed.") |
| 1447 | self = object.__new__(cls) |
| 1448 | self.__setstate(hour, minute or None) |
| 1449 | self._hashcode = -1 |
| 1450 | return self |
| 1451 | hour, minute, second, microsecond, fold = _check_time_fields( |
| 1452 | hour, minute, second, microsecond, fold) |
| 1453 | _check_tzinfo_arg(tzinfo) |
| 1454 | self = object.__new__(cls) |
| 1455 | self._hour = hour |
| 1456 | self._minute = minute |
no outgoing calls
searching dependent graphs…