faker icon indicating copy to clipboard operation
faker copied to clipboard

Problem about the new sugession type hint in vs code editor

Open RanaUniverse opened this issue 1 year ago • 2 comments

Yesterday after the new release of this library i tried to check diffent things, and found this below:::

image

image

as i got from the sugession i thought i can call the building name parameter without any parameter value and it will return a string, but it is not 😢

See when i get the type hint, i find this and try to get different things checking, but when i did it, i found, i got a suggestions as building_name but when i use it and then run this code in vs code, it shows like this, error, so i say is this type of suggestions is wrong here, how to stop this wrong suggestions here, or any mistake i am doing here ?

RanaUniverse avatar May 03 '24 04:05 RanaUniverse

The issue is that the type stubs are not locale-aware. They pull methods from providers across all locales, even if the instance you're using does not have the building_name method.

So let's say the address provider for jp_JP defines building_name(), but the en_US doesn't. building_name() will be in the suggestions even when you're using en_US.

fcurella avatar May 03 '24 19:05 fcurella

For this issue shouldn't we have some exception like

raise NotImplemented

for all localization classes

parsariyahi avatar Jun 10 '24 14:06 parsariyahi

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Sep 09 '24 01:09 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Sep 23 '24 01:09 github-actions[bot]