This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dataclasses as dtc | |
@dtc.dataclass | |
class Ok: | |
ok: "Nigger" | |
@dtc.dataclass | |
class Err: | |
err: "Gay" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import typing as t | |
import dataclasses as dtc | |
from functools import reduce | |
from pathlib import Path | |
class FileIsNotSupportedError(Exception): | |
def __init__(self, path: Path) -> None: | |
self.path = path | |
super().__init__(f"files of that kind are not supported by this compressor (path: {path})") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running `nixos-help`). | |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import typing as t | |
from dataclasses import dataclass | |
Tp: t.TypeAlias = """ | |
( | |
Struct | |
| Unknown | |
| Int | |
| Str | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import reduce as foldl | |
import string | |
import pprint | |
import builtins | |
class ParseFail(Exception): | |
... | |
def group_fails(message, *fails): | |
return ParseFail(f"{message}: {fails!r}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dataclasses import dataclass | |
from typing import ( | |
Self, | |
Callable, | |
Sequence, | |
TypeAlias, | |
TypeVar, | |
Protocol, | |
Any, | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Sole purpose of this thing - fix circular imports. | |
Consider, for example, message: | |
`slonogram.schemas.message.Message` depends on `slonogram.schemas.chat.Chat` | |
`Chat` also depends on `Message`, so that we got logically unsolvable circular imports problem. | |
This is the solution to it. | |
""" | |
from typing import Any, Iterable | |
from importlib import import_module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import ( | |
Generic, | |
TypeVar, | |
Protocol, | |
Any, | |
Type, | |
NewType, | |
) | |
T = TypeVar("T") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Lam<X> { | |
type Result; | |
} | |
struct True0; | |
struct True1<X>(X); | |
struct False0; | |
struct False1<X>(X); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Nat { | |
type Succ; | |
const NUMERIC: u64; | |
} | |
struct S<T>(T); | |
struct Z; | |
impl Nat for Z { |
NewerOlder