File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,8 +10,6 @@ A SICP'ish Points implemented in Python using hexlet-pairs.
1010 >>> p = points.make(100, 200)
1111 >>> print(points.to_string(p))
1212 (100, 200)
13- >>> points.get_quadrant(p)
14- 1
1513 >>> points.get_x(p)
1614 100
1715 >>> points.get_y(p)
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " hexlet-points"
3- version = " 0.1 .0"
3+ version = " 0.2 .0"
44description = " A SICP'ish Points implemented in Python using hexlet-pairs"
55authors = [" Hexlet Team <info@hexlet.io>" ]
66license = " ISC"
Original file line number Diff line number Diff line change 44
55from hexlet import pairs
66
7- __all__ = ( # noqa: WPS317
7+ __all__ = ( # noqa: WPS317
88 'make' ,
99 'get_x' , 'get_y' ,
10- 'to_string' , 'get_quadrant' ,
10+ 'to_string' ,
1111)
1212
1313
@@ -29,16 +29,3 @@ def get_y(point: pairs.Pair) -> int:
2929def to_string (point : pairs .Pair ) -> str :
3030 """Return a string representation of the point."""
3131 return repr ((get_x (point ), get_y (point )))
32-
33-
34- def get_quadrant (point : pairs .Pair ) -> int :
35- """Return a quadrant number for the point."""
36- return {
37- (True , True ): 1 ,
38- (False , True ): 2 ,
39- (False , False ): 3 ,
40- (True , False ): 4 ,
41- }[(
42- get_x (point ) > 0 ,
43- get_y (point ) > 0 ,
44- )]
Original file line number Diff line number Diff line change @@ -18,15 +18,3 @@ def test_to_string():
1818 assert points .to_string (p ) == '(100, 200)' , (
1919 'Should return a proper representation.'
2020 )
21-
22-
23- def test_get_quadrant ():
24- """Test to_string conversion."""
25- p1 = points .make (1 , 1 )
26- p2 = points .make (- 1 , 1 )
27- p3 = points .make (- 1 , - 1 )
28- p4 = points .make (1 , - 1 )
29- assert points .get_quadrant (p1 ) == 1 , 'Should detect a quadrant #1.'
30- assert points .get_quadrant (p2 ) == 2 , 'Should detect a quadrant #2.'
31- assert points .get_quadrant (p3 ) == 3 , 'Should detect a quadrant #3.'
32- assert points .get_quadrant (p4 ) == 4 , 'Should detect a quadrant #4.'
You can’t perform that action at this time.
0 commit comments