Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update building our first class.py #132

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Mar 21, 2023

  1. Update building our first class.py

    The comment before the class definition is misleading. It says "Below is the method how classes are defined" but it's not a method, it's an example of how to define a class.
    
    The class definition is incomplete. It only has the "pass" statement, which means it doesn't have any attributes or methods.
    
    The variable names "Varun" and "larry" should start with a lowercase letter according to Python naming conventions.
    
    The attributes are being added dynamically to the objects, which is not a good practice. It's better to define the attributes in the class definition.
    
    The attribute "subjects" is being assigned a list, which is fine, but the attribute "std" is being assigned an integer and a float value in different instances, which could cause issues if the class methods rely on those values being of the same type.
    nikitapandeyy authored Mar 21, 2023
    Configuration menu
    Copy the full SHA
    e34279c View commit details
    Browse the repository at this point in the history