FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codeql/python/ql/src/Functions/NonCls.qhelp at codeql-cli/v2.27.1 · github/codeql · GitHub
github
codeql
Repository navigation
Code
Issues
1k
(1k)
Pull requests
481
(481)
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codeql
/
python
/
ql
/
src
/
Functions
/
NonCls.qhelp
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (24 loc) · 1 KB
Breadcrumbs
codeql
/
python
/
ql
/
src
/
Functions
/
NonCls.qhelp
Copy path
File metadata and controls
35 lines (24 loc) · 1 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
<!
DOCTYPE
qhelp
PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<
qhelp
>
<
overview
>
<
p
> The first parameter of a class method (including certain special methods such as <
code
>__new__</
code
>), or a method of a metaclass,
should be named <
code
>cls</
code
>.
</
p
>
</
overview
>
<
recommendation
>
<
p
>Ensure that the first parameter of class methods is named <
code
>cls</
code
>, as recommended by the style guidelines
in PEP 8.</
p
>
</
recommendation
>
<
example
>
<
p
>In the following example, the first parameter of the class method <
code
>make</
code
> is named <
code
>self</
code
> instead of <
code
>cls</
code
>.
</
p
>
<
sample
src
=
"
NonCls.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
>
<
li
>Python Docs: <
a
href
=
"
https://docs.python.org/3/library/functions.html#classmethod
"
>classmethod</
a
>.</
li
>
</
references
>
</
qhelp
>
Back
|
FazBrowse Home
|
New Git URL