Created
January 3, 2025 17:38
-
-
Save goodki-d/a58e9312a684d5bb59423165f1cc10b3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 sanic import Sanic | |
import datetime | |
from dataclasses import dataclass | |
import timeit | |
app = Sanic(__name__) | |
def foo(): ... | |
@dataclass | |
class User: | |
id: str | |
@dataclass | |
class Org: | |
users: list[User] | |
app.repl_ctx.add_local(foo, "bar", "foo bar") | |
app.repl_ctx.add_local(User) | |
app.repl_ctx.add_local(Org) | |
app.repl_ctx.add_local(datetime) | |
app.repl_ctx.add_local(timeit) | |
@app.get("/") | |
async def hello(_): | |
pass |
Author
goodki-d
commented
Jan 3, 2025

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment