GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — learn-python/src/additions/test_pass.py at master · Mbaroudi/learn-python

Expand file tree

/

test_pass.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
46 lines (32 loc) · 1.25 KB
/

test_pass.py

Copy path

File metadata and controls

46 lines (32 loc) · 1.25 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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.