Skip to content

Commit

Permalink
Merge pull request #4 from knotgrass/master
Browse files Browse the repository at this point in the history
use .__int__() instead of int()
  • Loading branch information
vd2org authored Oct 9, 2023
2 parents 7ff141d + 064a46f commit a5539d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions snowflake/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __int__(self) -> int:
class SnowflakeGenerator:
def __init__(self, instance: int, *, seq: int = 0, epoch: int = 0, timestamp: Optional[int] = None):

current = int(time() * 1000.)
current = (time() * 1000.).__int__()

if current - epoch >= MAX_TS:
raise OverflowError(f"The maximum current timestamp has been reached in selected epoch,"
Expand Down Expand Up @@ -112,7 +112,7 @@ def __iter__(self):
return self

def __next__(self) -> Optional[int]:
current = int(time() * 1000.) - self._epo
current = (time() * 1000.).__int__() - self._epo

if current >= MAX_TS:
raise OverflowError(f"The maximum current timestamp has been reached in selected epoch,"
Expand Down

0 comments on commit a5539d9

Please sign in to comment.