usage of keyword pass in python [duplicate]
问题 This question already has answers here : How to use the pass statement? (15 answers) Closed 5 years ago . I have not seen the keyword pass used much in Python, except for the occasional exception, such as in here: Why is "except: pass" a bad programming practice? Are there any other example use-cases of pass which are acceptable/okay programming practice? 回答1: One use is to define a "stub" class or method that has a name but doesn't do anything. Maybe the most common case of this is to define