Lines Matching refs:fold

528 def _check_time_fields(hour, minute, second, microsecond, fold):
541 if fold not in (0, 1):
542 raise ValueError('fold must be either 0 or 1', fold)
543 return hour, minute, second, microsecond, fold
1336 hour, minute, second, microsecond, tzinfo, fold
1340 def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0):
1348 fold (keyword only, default to zero)
1366 hour, minute, second, microsecond, fold = _check_time_fields(
1367 hour, minute, second, microsecond, fold)
1376 self._fold = fold
1406 def fold(self):
1474 if self.fold:
1475 t = self.replace(fold=0)
1515 s = s[:-1] + ", fold=1)"
1612 tzinfo=True, *, fold=None):
1624 if fold is None:
1625 fold = self._fold
1626 return type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)
1678 microsecond=0, tzinfo=None, *, fold=0):
1696 hour, minute, second, microsecond, fold = _check_time_fields(
1697 hour, minute, second, microsecond, fold)
1709 self._fold = fold
1739 def fold(self):
1762 # As of version 2015f max fold in IANA database is
1768 # thus we can't perform fold detection for values of time less
1769 # than the max time fold. See comments in _datetimemodule's
1824 tzinfo, fold=time.fold)
1885 # Look for an earlier solution (if `fold` is 0), or a
1886 # later one (if `fold` is 1).
1887 u2 = u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]
1902 return (max, min)[self.fold](u1, u2)
1928 return time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)
1933 self._tzinfo, fold=self.fold)
1937 *, fold=None):
1955 if fold is None:
1956 fold = self.fold
1958 microsecond, tzinfo, fold=fold)
2052 s = s[:-1] + ", fold=1)"
2157 if myoff != self.replace(fold=not self.fold).utcoffset():
2159 if otoff != other.replace(fold=not other.fold).utcoffset():
2228 if self.fold:
2229 t = self.replace(fold=0)