JetBrains/intellij-community — pull request #130 by vkravets (2013-11-22 10:36:13+00:00)
Title: PY-11317 Incorrect type detection for formatter string with java String ...

Improve skeleton generator to using predefined return type in the doc generator
via user PREDEFINED_MOD_CLASS_SIGS map.

The main issue which is exists here related to that the str or unicode
in __mod__ method don't have any return type in the doc string.

We have such things:
1. Add in the generator3 in PREDEFINED_MOD_CLASS_SIGS signature for
str.__mod__ and unicode.__mod__ which will return correct type.
2. Described also in the doc string.

After applying 1 option I think that everything should work. But not =(
It seems that doc string have more priority then returned type (?) =(

Thus I also perform the add additional description to the doc which
describe return type in format which idea is parsing. Please note that
such behavior performs only for PREDEFINED_MOD_CLASS_SIGS

After regenerating the skeleton we have such picture:

```python
class unicode(basestring):

def __mod__(self, y): # known case of __builtin__.unicode.__mod__
"""
x.__mod__(y) <==> x%y

:type: unicode
"""
return u""
```

```python
class str(basestring):

def __mod__(self, y): # known case of __builtin__.str.__mod__
"""
x.__mod__(y) <==> x%y

:type: str
"""
return ""
```

And Idea detects correct type for formating string behavior.