python-dependency-injector icon indicating copy to clipboard operation
python-dependency-injector copied to clipboard

injection config and usage let IDE smart recognised

Open xinatcg opened this issue 2 years ago • 1 comments
trafficstars

is it possible to let IDE recognise the config parameter?

for example, when we register this application.config.aws.access_key_id.from_env("AWS_ACCESS_KEY_ID") we inject config to one service in the service, if want to use it we need to use config.aws.access_key_id to access it, but the IDE can only recognise it as string, we cannot use some functions such as find usage function

xinatcg avatar Jul 12 '23 14:07 xinatcg

@xinatcg hi!

I think in this case the only workaround that will help you is typing.cast. In this case, you will be fully responsible for the fact that you may indicate the wrong data type there

nightblure avatar Nov 13 '24 20:11 nightblure