Skip to content

Instantly share code, notes, and snippets.

@goodki-d
Created January 3, 2025 17:38
Show Gist options
  • Save goodki-d/a58e9312a684d5bb59423165f1cc10b3 to your computer and use it in GitHub Desktop.
Save goodki-d/a58e9312a684d5bb59423165f1cc10b3 to your computer and use it in GitHub Desktop.
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
@goodki-d
Copy link
Author

goodki-d commented Jan 3, 2025

ss

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