Ah, got it. We only need it for compiled modules. NVM.
Hmm... doesn't seem to be this case.
import re
if m := re.search('foo', 'foo'):
aa = m.group()
# ^^^^^ no docstring for `group`
>>> import inspect, re; m = re.search('foo', 'foo'); inspect.getdoc(m.group)
'group([group1, ...]) -> str or tuple.\nReturn subgroup(s) of the match by indices or names.\nFor 0 returns the entire match.'
There can a lot of built-in things still implemented in C. So I would still consider that dosctrings should be generated for the whole stdlib typeshed-fallback.
The case here is that the re module imports some of it's exports from a compiled module _sre, and the stubs for re.py don't accurately reflect this, instead specifying that they are defined within re.
Originally posted by @jfcherng in https://github.com/DetachHead/basedpyright/issues/420#issuecomment-2178640784