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