diff --git a/dataclasses.krk b/dataclasses.krk new file mode 100644 index 0000000..52d57b6 --- /dev/null +++ b/dataclasses.krk @@ -0,0 +1,24 @@ +let KW_ONLY = object() + +def _do_the_thing(cls, init, eq): + # Ordered dicts make this awesome + print(cls.__annotations__) + return cls + +def dataclass(cls=None, /, *, init=True, eq=True): + def _wrap(cls): + return _do_the_thing(cls,init,eq) + if cls is None: + return _wrap + return _wrap(cls) + +@dataclass +class Foo: + foo: int + bar: str + baz: str + qux: bool + def some_method(self): + pass + + diff --git a/src/sys.c b/src/sys.c index ad61566..d8d4d05 100644 --- a/src/sys.c +++ b/src/sys.c @@ -7,9 +7,9 @@ #define KRK_VERSION_MINOR 5 #define KRK_VERSION_PATCH 0 #define KRK_VERSION_LEVEL 0xa -#define KRK_VERSION_SERIAL 0x0 +#define KRK_VERSION_SERIAL 0x1 -#define KRK_VERSION_EXTRA_BASE "a0" +#define KRK_VERSION_EXTRA_BASE "a1" #ifndef KRK_STATIC_ONLY #define KRK_VERSION_EXTRA KRK_VERSION_EXTRA_BASE diff --git a/timeparse.krk b/timeparse.krk new file mode 100644 index 0000000..3e84bba --- /dev/null +++ b/timeparse.krk @@ -0,0 +1,4 @@ +for i in range(100): + for j in range(20): + for k in range(-20,20): + float(f'{i}.{j}e{k}')