Skip to content

added lesson 13: objects and classes#721

Open
3tom wants to merge 1 commit intojedzej:masterfrom
3tom:tomekDiakowTieto/lesson_13_objects_and_classes
Open

added lesson 13: objects and classes#721
3tom wants to merge 1 commit intojedzej:masterfrom
3tom:tomekDiakowTieto/lesson_13_objects_and_classes

Conversation

@3tom
Copy link

@3tom 3tom commented Jul 26, 2018

Dear @tomekDiakowTieto ,

Please take a look.

Thanks in advance,
Tomasz



class Rectangle:
def __init__(self, lower_left_corner=Point(0,0), width=0, height=0):
Copy link
Contributor

Choose a reason for hiding this comment

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

E231 missing whitespace after ','



class Circle:
def __init__(self, center=Point(0,0), radius=0):
Copy link
Contributor

Choose a reason for hiding this comment

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

E231 missing whitespace after ','

return True

def rect_circle_overlap(self, rectangle):
points_on_rect= []
Copy link
Contributor

Choose a reason for hiding this comment

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

E225 missing whitespace around operator

# We must slice rectangle fair enough to have two points lying on
# the same side of the rectangle closest to the center of circle
width_points = floor(20 * rectangle.width
/ (rectangle.height + rectangle.width)
Copy link
Contributor

Choose a reason for hiding this comment

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

W503 line break before binary operator

# the same side of the rectangle closest to the center of circle
width_points = floor(20 * rectangle.width
/ (rectangle.height + rectangle.width)
+ 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

W503 line break before binary operator

assert rect_in_circle(circle, test_input) == expected


@pytest.mark.parametrize("test_input, expected", [
Copy link
Contributor

Choose a reason for hiding this comment

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

F811 redefinition of unused 'test_eval' from line 24

self.weight = weight
self.sugar = sugar

class ChocolateBar:
Copy link
Contributor

Choose a reason for hiding this comment

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

E302 expected 2 blank lines, found 1


return ret

def main():
Copy link
Contributor

Choose a reason for hiding this comment

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

E302 expected 2 blank lines, found 1

print("-----------------------------")
pprint(inspect_specific_object_attributes(nussbeisser))

if __name__ == "__main__":
Copy link
Contributor

Choose a reason for hiding this comment

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

E305 expected 2 blank lines after class or function definition, found 1

original_nussbeisser = ChocolateBar(Sweet(100, 40.5), 6, ["milk", "nuts"],
"nutty", 15.7)
alpengold_nussbeisser = ChocolateBar(Sweet(100, 46.5), 6, ["milk", "nuts"],
"nutty", 14.5)
Copy link
Contributor

Choose a reason for hiding this comment

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

E128 continuation line under-indented for visual indent

@3tom 3tom force-pushed the tomekDiakowTieto/lesson_13_objects_and_classes branch from 957449c to f67ce2c Compare July 26, 2018 15:14
Completed all exercises for lesson 13.

Signed-off-by: Tomasz Medrek <tomasz.medrek@tieto.com>
@3tom 3tom force-pushed the tomekDiakowTieto/lesson_13_objects_and_classes branch from f67ce2c to 7e5bea5 Compare July 26, 2018 15:32
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