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 — codeql/python/ql/src/Functions/NonSelf.qhelp at codeql-cli/v2.19.1 · github/codeql Expand file tree/ Copy pathNonSelf.qhelpMore file actions 38 lines (28 loc) · 1.17 KB / Copy pathNonSelf.qhelpFile metadata and controls38 lines (28 loc) · 1.17 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 <!DOCTYPE qhelp PUBLIC "-//Semmle//qhelp//EN" "qhelp.dtd"> <qhelp> <overview> <p> Normal methods should have at least one parameter and the first parameter should be called <code>self</code>. This makes the purpose of the parameter clear to other developers. </p> </overview> <recommendation> <p>If there is at least one parameter, then change the name of the first parameter to <code>self</code> as recommended by the style guidelines in PEP 8.</p> <p>If there are no parameters, then it cannot be a normal method. It may need to be marked as a <code>staticmethod</code> or it could be moved out of the class as a normal function. </p> </recommendation> <example> <p>The following methods can both be used to assign values to variables in a <code>point</code> object. The second method makes the association clearer because the <code>self</code> parameter is used.</p> <sample src="NonSelf.py" /> </example> <references> <li>Python PEP 8: <a href="http://www.python.org/dev/peps/pep-0008/#function-and-method-arguments">Function and method arguments</a>.</li> <li>Python Tutorial: <a href="http://docs.python.org/2/tutorial/classes.html">Classes</a>.</li> </references> </qhelp> |
| You are visitor 01402775 — 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. |