Added skeletons for built-in numeric types

This commit is contained in:
Andrey Vlasovskikh
2013-09-09 18:38:23 +04:00
parent 0a6ba82d90
commit fe3540e62b
9 changed files with 8 additions and 476 deletions
-468
View File
@@ -1,474 +1,6 @@
# Python stdlib
## 5.4. Numeric types
__builtin__.int.__init__ = \
:type x: object \n\
:type base: bool or int or long or float or complex or None \n\
:rtype: int \n\
__builtin__.int.__add__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__sub__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__mul__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__floordiv__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__mod__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__pow__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__lshift__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__rshift__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__and__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__or__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__xor__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__div__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__truediv__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__radd__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__rsub__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__rmul__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__rfloordiv__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__rmod__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__rpow__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__rlshift__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__rrshift__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__rand__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__ror__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__rxor__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__rdiv__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__rtruediv__ = \
:type y: int or long or float or complex \n\
:rtype: int \n\
__builtin__.int.__pos__ = \
:rtype: int \n\
__builtin__.int.__neg__ = \
:rtype: int \n\
__builtin__.int.__invert__ = \
:rtype: int \n\
__builtin__.long.__init__ = \
:type x: object \n\
:type base: bool or int or long or float or complex or None \n\
:rtype: long \n\
__builtin__.long.__add__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__sub__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__mul__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__floordiv__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__mod__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__pow__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__lshift__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__rshift__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__and__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__or__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__xor__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__div__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__truediv__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__radd__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__rsub__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__rmul__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__rfloordiv__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__rmod__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__rpow__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__rlshift__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__rrshift__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__rand__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__ror__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__rxor__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__rdiv__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__rtruediv__ = \
:type y: int or long or float or complex \n\
:rtype: long \n\
__builtin__.long.__pos__ = \
:rtype: long \n\
__builtin__.long.__neg__ = \
:rtype: long \n\
__builtin__.long.__invert__ = \
:rtype: long \n\
__builtin__.float.__init__ = \
:type x: object \n\
:rtype: float \n\
__builtin__.float.__add__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__sub__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__mul__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__floordiv__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__mod__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__pow__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__lshift__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__rshift__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__and__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__or__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__xor__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__div__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__truediv__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__radd__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__rsub__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__rmul__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__rfloordiv__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__rmod__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__rpow__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__rlshift__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__rrshift__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__rand__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__ror__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__rxor__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__rdiv__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__rtruediv__ = \
:type y: int or long or float or complex \n\
:rtype: float \n\
__builtin__.float.__pos__ = \
:rtype: float \n\
__builtin__.float.__neg__ = \
:rtype: float \n\
__builtin__.complex.__init__ = \
:type real: object \n\
:type imag: object or None \n\
:rtype: complex \n\
__builtin__.complex.__add__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__sub__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__mul__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__floordiv__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__mod__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__pow__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__lshift__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__rshift__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__and__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__or__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__xor__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__div__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__truediv__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__radd__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__rsub__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__rmul__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__rfloordiv__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__rmod__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__rpow__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__rlshift__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__rrshift__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__rand__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__ror__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__rxor__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__rdiv__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__rtruediv__ = \
:type y: int or long or float or complex \n\
:rtype: complex \n\
__builtin__.complex.__pos__ = \
:rtype: complex \n\
__builtin__.complex.__neg__ = \
:rtype: complex \n\
## 5.6. Sequence types
__builtin__.bytes.__init__ = \
@@ -9,4 +9,4 @@ def test():
x = f(10)
y = f('foo')
z = f(<warning descr="Expected type 'T <= int | str', got 'list' instead">[]</warning>)
return x + <warning descr="Expected type 'int | long | float | complex', got 'str' instead">y</warning>
return x + <warning descr="Expected type 'Number', got 'str' instead">y</warning>
@@ -5,4 +5,4 @@ def test_dict_generics(d):
xs = d.items()
d2 = dict(xs)
for k, v in d2.items():
print k + <warning descr="Expected type 'int | long | float | complex', got 'unicode' instead">v</warning>
print k + <warning descr="Expected type 'Number', got 'unicode' instead">v</warning>
@@ -1,7 +1,7 @@
def test():
xs = {'foo': 1, 'bar': 2}
for v in xs.values():
print(v + <warning descr="Expected type 'int | long | float | complex', got 'None' instead">None</warning>)
print(v + <warning descr="Expected type 'Number', got 'None' instead">None</warning>)
for k in xs.keys():
print(k + <warning descr="Expected type 'str | unicode', got 'None' instead">None</warning>)
for k in xs:
@@ -20,7 +20,7 @@ def test_generic_user_class():
self.x = value
c = User1(10)
print(c.get() + <warning descr="Expected type 'int | long | float | complex', got 'str' instead">'foo'</warning>)
print(c.get() + <warning descr="Expected type 'Number', got 'str' instead">'foo'</warning>)
c.put(14)
c.put(<weak_warning descr="Expected type 'int' (matched generic type 'T'), got 'str' instead">'foo'</weak_warning>)
@@ -38,7 +38,7 @@ def test():
result = f1([1, 2, 3])
print(result)
print(result + <warning descr="Expected type 'int | long | float | complex', got 'str' instead">'foo'</warning>)
print(result + <warning descr="Expected type 'Number', got 'str' instead">'foo'</warning>)
f2(1, <weak_warning descr="Expected type 'list[int]' (matched generic type 'list[T]'), got 'list[str]' instead">['foo']</weak_warning>, 'bar')
@@ -5,4 +5,4 @@ def test():
c = C()
x = c.f()
y = x
return y + <warning descr="Expected type 'int | long | float | complex', got 'str' instead">'foo'</warning>
return y + <warning descr="Expected type 'Number', got 'str' instead">'foo'</warning>
@@ -2,4 +2,4 @@ def test():
xs = map(lambda x: x + 1, [1, 2, 3])
print('foo' + <warning descr="Expected type 'str | unicode', got 'int' instead">xs[0]</warning>)
ys = map(str, iter([1, 2, 3]))
print(1 + <warning descr="Expected type 'int | long | float | complex', got 'str' instead">ys[0]</warning>, 'bar' + ys[1])
print(1 + <warning descr="Expected type 'Number', got 'str' instead">ys[0]</warning>, 'bar' + ys[1])
@@ -2,7 +2,7 @@ def test():
print('foo' + 'bar')
print(2 + 3)
print('foo' + <warning descr="Expected type 'str | unicode', got 'int' instead">3</warning>)
print(3 + <warning descr="Expected type 'int | long | float | complex', got 'str' instead">'foo'</warning>)
print(3 + <warning descr="Expected type 'Number', got 'str' instead">'foo'</warning>)
print('foo' + 'bar' * 3)
print('foo' + 3 * 'bar')
print('foo' + <warning descr="Expected type 'str | unicode', got 'int' instead">2 * 3</warning>)