MCPcopy Index your code
hub / github.com/RustPython/RustPython / _check_time_fields

Function _check_time_fields

Lib/_pydatetime.py:571–586  ·  view source on GitHub ↗
(hour, minute, second, microsecond, fold)

Source from the content-addressed store, hash-verified

569 return year, month, day
570
571def _check_time_fields(hour, minute, second, microsecond, fold):
572 hour = _index(hour)
573 minute = _index(minute)
574 second = _index(second)
575 microsecond = _index(microsecond)
576 if not 0 <= hour <= 23:
577 raise ValueError(f"hour must be in 0..23, not {hour}")
578 if not 0 <= minute <= 59:
579 raise ValueError(f"minute must be in 0..59, not {minute}")
580 if not 0 <= second <= 59:
581 raise ValueError(f"second must be in 0..59, not {second}")
582 if not 0 <= microsecond <= 999999:
583 raise ValueError(f"microsecond must be in 0..999999, not {microsecond}")
584 if fold not in (0, 1):
585 raise ValueError(f"fold must be either 0 or 1, not {fold}")
586 return hour, minute, second, microsecond, fold
587
588def _check_tzinfo_arg(tz):
589 if tz is not None and not isinstance(tz, tzinfo):

Callers 2

__new__Method · 0.85
__new__Method · 0.85

Calls 1

_indexFunction · 0.85

Tested by

no test coverage detected