Skip to content

πŸ“[Docs]: Constructor in Python Chapter to Python OOP DocumentationΒ #829

@codewithdhruba01

Description

@codewithdhruba01

Is there an existing issue for this?

  • I have searched the existing issues

Issue Description

A new documentation chapter titled "Constructor in Python" should be added under the Python Object-Oriented Programming (OOP) section. The chapter should explain:

  • What is a constructor in Python
  • Purpose of the __init__() method
  • Default vs parameterized constructors
  • Constructor behavior during object creation
  • Use of self in constructors
  • Code examples to demonstrate constructor usage

Suggested Change

Why is this important?

  • The current Python OOP section covers important topics like classes, inheritance, and polymorphism, but constructors are missing.
  • Constructors are essential for object initialization and are a core concept in Python OOP.
  • Including this topic will make the documentation more comprehensive and helpful for Python learners.

Rationale

What needs to be done?

  • Create a new markdown or documentation file, e.g., constructor-in-python.md, inside the Python OOP folder.
  • Add a link to this chapter in the sidebar under the Python > OOP section.
  • Follow the same format and structure used in other OOP chapters (e.g., Classes and Objects).
  • Add at least 2–3 example code snippets explaining constructor behavior.

Urgency

High

Record

  • I have read the Contributing Guidelines
  • Are you a GSSOC'25 contributor
  • I want to work on this issue

Metadata

Metadata

Type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions