File tree Expand file tree Collapse file tree 4 files changed +3
-30
lines changed Expand file tree Collapse file tree 4 files changed +3
-30
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,6 @@ A SICP'ish Points implemented in Python using hexlet-pairs.
10
10
>>> p = points.make(100, 200)
11
11
>>> print(points.to_string(p))
12
12
(100, 200)
13
- >>> points.get_quadrant(p)
14
- 1
15
13
>>> points.get_x(p)
16
14
100
17
15
>>> points.get_y(p)
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " hexlet-points"
3
- version = " 0.1 .0"
3
+ version = " 0.2 .0"
4
4
description = " A SICP'ish Points implemented in Python using hexlet-pairs"
5
5
authors = [" Hexlet Team <info@hexlet.io>" ]
6
6
license = " ISC"
Original file line number Diff line number Diff line change 4
4
5
5
from hexlet import pairs
6
6
7
- __all__ = ( # noqa: WPS317
7
+ __all__ = ( # noqa: WPS317
8
8
'make' ,
9
9
'get_x' , 'get_y' ,
10
- 'to_string' , 'get_quadrant' ,
10
+ 'to_string' ,
11
11
)
12
12
13
13
@@ -29,16 +29,3 @@ def get_y(point: pairs.Pair) -> int:
29
29
def to_string (point : pairs .Pair ) -> str :
30
30
"""Return a string representation of the point."""
31
31
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():
18
18
assert points .to_string (p ) == '(100, 200)' , (
19
19
'Should return a proper representation.'
20
20
)
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