Created
March 3, 2024 17:29
-
-
Save tdsmith/301461ba3b95c64bdea51bf9d7eea0c6 to your computer and use it in GitHub Desktop.
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 Annotated | |
import svcs | |
with svcs.Registry() as reg: | |
reg.register_value(Annotated[int, "my_int"], 42) | |
reg.register_value(float, 3.14) |
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
/Users/tim/tmp/demo.py | |
/Users/tim/tmp/demo.py:6:24 - error: Argument of type "type[int]" cannot be assigned to parameter "svc_type" of type "type" in function "register_value" (reportArgumentType) | |
1 error, 0 warnings, 0 informations |
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
pyright | |
svcs |
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
# | |
# This file is autogenerated by pip-compile with Python 3.12 | |
# by the following command: | |
# | |
# pip-compile | |
# | |
attrs==23.2.0 | |
# via svcs | |
nodeenv==1.8.0 | |
# via pyright | |
pyright==1.1.352 | |
# via -r requirements.in | |
svcs==24.1.0 | |
# via -r requirements.in | |
# The following packages are considered to be unsafe in a requirements file: | |
# setuptools |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment