| 1 |
|
| 2 |
|
| 3 |
try: |
| 4 |
enumerate = enumerate |
| 5 |
except NameError: |
| 6 |
|
| 7 |
def enumerate(iterable): |
| 8 |
"""emulates the python2.3 enumerate() function""" |
| 9 |
i = 0 |
| 10 |
for val in iterable: |
| 11 |
yield i, val |
| 12 |
i += 1 |
| 13 |
|
| 14 |
def toto(value): |
| 15 |
for k, v in value: |
| 16 |
print(v.get('yo')) |
| 17 |
|
| 18 |
|
| 19 |
import optparse as s_opt |
| 20 |
|
| 21 |
class OptionParser(s_opt.OptionParser): |
| 22 |
|
| 23 |
def parse_args(self, args=None, values=None, real_optparse=False): |
| 24 |
if real_optparse: |
| 25 |
pass |
| 26 |
## return super(OptionParser, self).parse_args() |
| 27 |
else: |
| 28 |
import optcomp |
| 29 |
optcomp.completion(self) |
| 30 |
|
| 31 |
|
| 32 |
class Aaa(object): |
| 33 |
"""docstring""" |
| 34 |
def __init__(self): |
| 35 |
self.__setattr__('a','b') |
| 36 |
pass |
| 37 |
|
| 38 |
def one_public(self): |
| 39 |
"""docstring""" |
| 40 |
pass |
| 41 |
|
| 42 |
def another_public(self): |
| 43 |
"""docstring""" |
| 44 |
pass |
| 45 |
|
| 46 |
class Ccc(Aaa): |
| 47 |
"""docstring""" |
| 48 |
|
| 49 |
class Ddd(Aaa): |
| 50 |
"""docstring""" |
| 51 |
pass |
| 52 |
|
| 53 |
class Eee(Ddd): |
| 54 |
"""docstring""" |
| 55 |
pass |