mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
remove the ability of datetime.time to be considered false (closes #13936)
This commit is contained in:
parent
265ae86414
commit
ee6bdc07d6
6 changed files with 20 additions and 64 deletions
|
@ -1249,12 +1249,6 @@ class time:
|
|||
_check_tzinfo_arg(tzinfo)
|
||||
return time(hour, minute, second, microsecond, tzinfo)
|
||||
|
||||
def __bool__(self):
|
||||
if self.second or self.microsecond:
|
||||
return True
|
||||
offset = self.utcoffset() or timedelta(0)
|
||||
return timedelta(hours=self.hour, minutes=self.minute) != offset
|
||||
|
||||
# Pickle support.
|
||||
|
||||
def _getstate(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue