Title: Python Class Methods and the cls Parameter
Open Graph Title: Python Class Methods and the cls Parameter
X Title: Python Class Methods and the cls Parameter
Description: A class method works on the class itself instead of on one object. Learn when to use it, what cls does and how it differs from an instance method.
Open Graph Description: A class method works on the class itself instead of on one object. Learn when to use it, what cls does and how it differs from an instance method.
X Description: A class method works on the class itself instead of on one object. Learn when to use it, what cls does and how it differs from an instance method.
Opengraph URL: https://pythonprogramminglanguage.com/class-methods/
Domain: pythonprogramminglanguage.com
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebSite",
"@id": "https://pythonprogramminglanguage.com/#website",
"url": "https://pythonprogramminglanguage.com/",
"name": "Python Programming Language",
"description": "Free Python tutorials with clear explanations and code you can run.",
"inLanguage": "en",
"publisher": {
"@id": "https://pythonprogramminglanguage.com/#org"
}
},
{
"@type": "Organization",
"@id": "https://pythonprogramminglanguage.com/#org",
"name": "pythonprogramminglanguage.com",
"url": "https://pythonprogramminglanguage.com/",
"logo": {
"@type": "ImageObject",
"url": "https://pythonprogramminglanguage.com/images/og-default.png",
"width": 1200,
"height": 630
}
},
{
"@type": "BreadcrumbList",
"@id": "https://pythonprogramminglanguage.com/class-methods/#breadcrumb",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://pythonprogramminglanguage.com/"
},
{
"@type": "ListItem",
"position": 2,
"name": "Python OOP programming tutorial",
"item": "https://pythonprogramminglanguage.com/oop/"
},
{
"@type": "ListItem",
"position": 3,
"name": "The purpose of Class Methods",
"item": "https://pythonprogramminglanguage.com/class-methods/"
}
]
},
{
"@type": "TechArticle",
"@id": "https://pythonprogramminglanguage.com/class-methods/#article",
"isPartOf": {
"@id": "https://pythonprogramminglanguage.com/#website"
},
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://pythonprogramminglanguage.com/class-methods/"
},
"headline": "Python Class Methods and the cls Parameter",
"name": "The purpose of Class Methods",
"description": "A class method works on the class itself instead of on one object. Learn when to use it, what cls does and how it differs from an instance method.",
"inLanguage": "en",
"image": [
"https://pythonprogramminglanguage.com/images/og-default.png"
],
"datePublished": "2017-03-24",
"dateModified": "2026-10-01",
"wordCount": 490,
"proficiencyLevel": "Beginner",
"articleSection": "Object oriented programming",
"author": {
"@id": "https://pythonprogramminglanguage.com/#org"
},
"publisher": {
"@id": "https://pythonprogramminglanguage.com/#org"
}
},
{
"@type": "WebPage",
"@id": "https://pythonprogramminglanguage.com/class-methods/#webpage",
"url": "https://pythonprogramminglanguage.com/class-methods/",
"name": "Python Class Methods and the cls Parameter",
"description": "A class method works on the class itself instead of on one object. Learn when to use it, what cls does and how it differs from an instance method.",
"isPartOf": {
"@id": "https://pythonprogramminglanguage.com/#website"
},
"inLanguage": "en",
"breadcrumb": {
"@id": "https://pythonprogramminglanguage.com/class-methods/#breadcrumb"
}
}
]
}
| theme-color | #4184f3 |
| og:type | article |
| og:site_name | Python Programming Language |
| og:locale | en_US |
| og:image | https://pythonprogramminglanguage.com/images/og-default.png |
| og:image:width | 1200 |
| og:image:height | 630 |
| og:image:alt | pythonprogramminglanguage.com, free Python tutorials with runnable code examples |
| article:published_time | 2017-03-24T00:00:00+00:00 |
| article:modified_time | 2026-10-01T00:00:00+00:00 |
| article:section | Object oriented programming |
| twitter:card | summary_large_image |
| twitter:image | https://pythonprogramminglanguage.com/images/og-default.png |
Links:
Viewport: width=device-width, initial-scale=1
Robots: index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1