Commit f0fe2a22 authored by gsamain's avatar gsamain

PEP-8 indent for type inference test

parent 1e402dfa
cdef cypclass SomeMemory: cdef cypclass SomeMemory:
int a int a
void __init__(self, int a=0): void __init__(self, int a=0):
self.a = a self.a = a
SomeMemory __add__(self, SomeMemory other): SomeMemory __add__(self, SomeMemory other):
return SomeMemory(self.a + other.a) return SomeMemory(self.a + other.a)
SomeMemory __iadd__(self, SomeMemory other): SomeMemory __iadd__(self, SomeMemory other):
self.a += other.a self.a += other.a
SomeMemory __mul__(self, SomeMemory other): SomeMemory __mul__(self, SomeMemory other):
return SomeMemory(self.a * other.a) return SomeMemory(self.a * other.a)
cdef cypclass SomeSubMemory(SomeMemory): cdef cypclass SomeSubMemory(SomeMemory):
int b int b
cpdef bag(): cpdef bag():
o1 = SomeMemory() o1 = SomeMemory()
o2 = SomeMemory(4) o2 = SomeMemory(4)
o3 = SomeSubMemory(3) o3 = SomeSubMemory(3)
o3 += o2 o3 += o2
o1 = o2 * o3 o1 = o2 * o3
return str(o1.a) + '\n' + str(o2.a) + '\n' + str(o3.a) return str(o1.a) + '\n' + str(o2.a) + '\n' + str(o3.a)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment