Skip to content

Classes#1

Open
laraib-W wants to merge 5 commits into
masterfrom
classes
Open

Classes#1
laraib-W wants to merge 5 commits into
masterfrom
classes

Conversation

@laraib-W

@laraib-W laraib-W commented Aug 4, 2022

Copy link
Copy Markdown
Owner

Practiced python classes concepts.

Comment thread src/classes/test_inheritance.py Outdated
"""
def __init__(self, name, staff_id):
Person.__init__(self, name)
#Person.__init__(self, name)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the commented code


time = '11:23 PM'

def getparentdata(self):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the snake case while defining any function name.


date = '12/08/2018'

def getparentdata(self):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snake case here as well.

def test_multiple_inheritance():
"""Multiple Inheritance"""

class Parent:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this example you'll have to test multiple inheritance, while you are testing only simple inheritance.

Comment thread src/classes/test_practice_classes.py Outdated
# Each car has separate features list
assert car1.features == ["Back Camera"]


No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add EOL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants