Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class A(object):
- def do_nothing(self):
- return self
- def fail(self, t):
- raise RuntimeError('fail')
- def main():
- a = A()
- (a
- .do_nothing()
- .do_nothing()
- .fail(True)
- .fail(True)
- .do_nothing()
- )
- if __name__ == '__main__':
- main()
- # $ python3.7 script.py
- # Traceback (most recent call last):
- # File "script.py", line 22, in <module>
- # main()
- # File "script.py", line 15, in main
- # .fail(True)
- # File "script.py", line 6, in fail
- # raise RuntimeError('fail')
- # RuntimeError: fail
- # $ python3.9 script.py
- # Traceback (most recent call last):
- # File "/home/komendart/temp/script.py", line 22, in <module>
- # main()
- # File "/home/komendart/temp/script.py", line 12, in main
- # (a
- # File "/home/komendart/temp/script.py", line 6, in fail
- # raise RuntimeError('fail')
- # RuntimeError: fail
Advertisement
Add Comment
Please, Sign In to add comment