Skip to content

Commit

Permalink
Update changelog. Use "is" instead of "==" to compare to True and False.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Feb 6, 2020
1 parent 916fbd4 commit bc72327
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* :meth:`.Date.__init__` and :meth:`.DateTime.__init__` accepts a ``locale`` keyword argument (e.g. :code:`en_US`) for parsing formatted dates. (#730)
* :meth:`.utils.max_precision` ignores infinity when calculating precision. (#726)
* :meth:`.Date.cast` catches ``OverflowError`` when type testing. (#720)
* :meth:`.Number.cast` casts ``True`` to ``1`` and ``False`` to ``0``. (#733)
* Included examples in Python package. (#716)

1.6.1 - March 11, 2018
Expand Down
4 changes: 2 additions & 2 deletions agate/data_types/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def cast(self, d):
return Decimal(d)
elif t is float:
return Decimal(repr(d))
elif d == False:
elif d is False:
return Decimal(0)
elif d == True:
elif d is True:
return Decimal(1)
elif not isinstance(d, six.string_types):
raise CastError('Can not parse value "%s" as Decimal.' % d)
Expand Down

0 comments on commit bc72327

Please sign in to comment.