GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — learn-python/src/additions/test_pass.py at master · hlixing/learn-python Expand file tree/ Copy pathtest_pass.pyMore file actions 46 lines (32 loc) · 1.25 KB / Copy pathtest_pass.pyFile metadata and controls46 lines (32 loc) · 1.25 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 """PASS statement @see: https://docs.python.org/3/tutorial/controlflow.html The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action. """ def test_pass_in_function(): """PASS statement in function "Pass" can be used as a place-holder for a function or conditional body when you are working on new code, allowing you to keep thinking at a more abstract level. The pass statement below is silently ignored but it makes current test_pass() function valid. """ pass def test_pass_in_loop(): """PASS in loops. "Pass" can be used when a statement is required syntactically but the program requires no action. For example: """ # pylint: disable=unused-variable for number in range(100): # It just don't do anything but for loop is still valid. pass # Example above is quite useless but it was given just for illustration of the idea. # The more useful example might be: # # while True: # pass # Busy-wait for keyboard interrupt (Ctrl+C) # pylint: disable=too-few-public-methods class MyEmptyClass: """PASS statement in class "Pass" is commonly used for creating minimal classes like current one. """ pass |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |