summaryrefslogtreecommitdiff
path: root/msgpack/ext.py
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2022-03-03 12:29:55 +0900
committerGitHub <noreply@github.com>2022-03-03 12:29:55 +0900
commitcb50b2081b21e5cb4a364d292f55092c98aa1a6f (patch)
treece97035a3f9c129ab52e665b21a7124cf55d5500 /msgpack/ext.py
parent89ea57747ebcb0fad004a92ab00ebf13c10b2d51 (diff)
downloadmsgpack-python-cb50b2081b21e5cb4a364d292f55092c98aa1a6f.tar.gz
Update setuptools and black (#498)
* Use setuptools * Use black==22.1.0
Diffstat (limited to 'msgpack/ext.py')
-rw-r--r--msgpack/ext.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/msgpack/ext.py b/msgpack/ext.py
index 4eb9dd6..25544c5 100644
--- a/msgpack/ext.py
+++ b/msgpack/ext.py
@@ -59,7 +59,7 @@ class Timestamp(object):
raise TypeError("seconds must be an interger")
if not isinstance(nanoseconds, int_types):
raise TypeError("nanoseconds must be an integer")
- if not (0 <= nanoseconds < 10 ** 9):
+ if not (0 <= nanoseconds < 10**9):
raise ValueError(
"nanoseconds must be a non-negative integer less than 999999999."
)
@@ -143,7 +143,7 @@ class Timestamp(object):
:type unix_float: int or float.
"""
seconds = int(unix_sec // 1)
- nanoseconds = int((unix_sec % 1) * 10 ** 9)
+ nanoseconds = int((unix_sec % 1) * 10**9)
return Timestamp(seconds, nanoseconds)
def to_unix(self):
@@ -161,7 +161,7 @@ class Timestamp(object):
:param int unix_ns: Posix timestamp in nanoseconds.
:rtype: Timestamp
"""
- return Timestamp(*divmod(unix_ns, 10 ** 9))
+ return Timestamp(*divmod(unix_ns, 10**9))
def to_unix_nano(self):
"""Get the timestamp as a unixtime in nanoseconds.
@@ -169,7 +169,7 @@ class Timestamp(object):
:returns: posix timestamp in nanoseconds
:rtype: int
"""
- return self.seconds * 10 ** 9 + self.nanoseconds
+ return self.seconds * 10**9 + self.nanoseconds
def to_datetime(self):
"""Get the timestamp as a UTC datetime.