from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def _py_backwards_merge_dicts(dicts):
result = {}
for dict_ in dicts:
result.update(dict_)
return result
def returning_range(x):
_py_backwards_iterable_6 = iter(range(x))
while True:
try:
(yield next(_py_backwards_iterable_6))
except StopIteration as _py_backwards_exc_5:
break
_py_backwards_exc_9 = StopIteration()
_py_backwards_exc_9.value = x
raise _py_backwards_exc_9
def x_printer(x):
_py_backwards_iterable_8 = iter(returning_range(x))
while True:
try:
(yield next(_py_backwards_iterable_8))
except StopIteration as _py_backwards_exc_7:
if hasattr(_py_backwards_exc_7, 'value'):
val = _py_backwards_exc_7.value
break
print(''.join(['val ', '{}'.format(val)]))
def formatter(x):
items = (list(x_printer(x)) + [x]) # type: list
print(*(list(items) + list(items)))
return {'items': items}
result = _py_backwards_merge_dicts([{'x': 10}, dict(formatter(10))])
print(result)
class NumberManager(object):
def ten(self):
return 10
@classmethod
def eleven(cls):
return 11
class ImportantNumberManager(NumberManager):
def ten(self):
return super(ImportantNumberManager, self).ten()
@classmethod
def eleven(cls):
return super(ImportantNumberManager, cls).eleven()
print(ImportantNumberManager().ten())
print(ImportantNumberManager.eleven())