still bugs in snowflake (!)

This commit is contained in:
Yusur 2025-06-18 10:17:00 +02:00
parent 01d0464da2
commit e5d9c8e4a6
3 changed files with 9 additions and 5 deletions

View file

@ -1,5 +1,9 @@
# Changelog # Changelog
## 0.3.3
- Fixed leftovers in `snowflake` module from unchecked code copying — i.e. `SnowflakeGen.generate_one()` used to require an unused typ= parameter
## 0.3.2 ## 0.3.2
- Fixed bugs in Snowflake generation and serialization of negative values - Fixed bugs in Snowflake generation and serialization of negative values

View file

@ -27,7 +27,7 @@ from .itertools import makelist, kwargs_prefix, ltuple, rtuple, additem
from .i18n import I18n, JsonI18n, TomlI18n from .i18n import I18n, JsonI18n, TomlI18n
from .snowflake import Snowflake, SnowflakeGen from .snowflake import Snowflake, SnowflakeGen
__version__ = "0.3.2" __version__ = "0.3.3.rc1"
__all__ = ( __all__ = (
'Siq', 'SiqCache', 'SiqType', 'SiqGen', 'StringCase', 'Siq', 'SiqCache', 'SiqType', 'SiqGen', 'StringCase',

View file

@ -108,10 +108,10 @@ class SnowflakeGen:
n -= 1 n -= 1
self.counter += 1 self.counter += 1
yield siq yield siq
def generate_one(self, /, typ: SiqType) -> int: def generate_one(self, /) -> int:
return next(self.generate(typ, 1)) return next(self.generate(1))
def generate_list(self, /, typ: SiqType, n: int = 1) -> list[int]: def generate_list(self, /, n: int = 1) -> list[int]:
return list(self.generate(typ, n)) return list(self.generate(n))
class Snowflake(int): class Snowflake(int):