dishka icon indicating copy to clipboard operation
dishka copied to clipboard

FromComponent type hints

Open Forceres opened this issue 1 year ago • 2 comments

@provide(scope=Scope.APP)
def provide_database_connection_options(
        self,
        config: Annotated[DatabaseConfig, FromComponent(Component.SHARED)],
    ) -> DatabaseConnectionOptions:
        return DatabaseConnectionOptions(dsn=config.DATABASE_DSN, schema=self._schema)

something like that will raise IDE type warnings

Forceres avatar Aug 17 '24 16:08 Forceres

Which IDE are you using? Looks like a bug in Pycharm.

Tishka17 avatar Aug 17 '24 17:08 Tishka17

Which IDE are you using? Looks like a bug in Pycharm.

Pycharm, yeah

Forceres avatar Aug 17 '24 18:08 Forceres

Done in #233

Tishka17 avatar Sep 19 '24 21:09 Tishka17