【python】零碎知识
本文目录 1 个章节
【python】零碎知识
# 【python】零碎知识
创建时间:2021/8/30 15:17
- foo, bar
foo, bar
Used very generally as a sample name for absolutely anything , esp. programs and files (esp. scratch files). First on the standard list of metasyntactic variables used in syntax examples (bar, baz, qux, quux, corge, grault, garply, waldo, fred, plugh, xyzzy, thud). [JARGON]
foo is used as a place-holder name, usually in example code to signify that the object being named, or the choice of name, is not part of the crux of the example. foo is often followed by bar, baz, and even bundy, if more than one such name is needed. Wikipedia calls these names Metasyntactic Variables. Python programmers supposedly use spam, eggs, ham, instead of foo, etc.
I have also seen foo used when the programmer can't think of a meaningful name (as a substitute for tmp, say)
Ref: https://stackoverflow.com/questions/53609/what-does-foo-really-mean