From 999879d74fd526cc0e756b95de98bb0dd1b9091e Mon Sep 17 00:00:00 2001 From: SW Baek Date: Fri, 14 Feb 2025 00:10:38 +0900 Subject: [PATCH 1/6] Update __init__.py From 633cf6d75d65595b1502ba7169aef7737e97672d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=B1=EC=8A=B9=EC=9A=B0?= Date: Fri, 14 Feb 2025 00:16:24 +0900 Subject: [PATCH 2/6] Refactor import statement for Rank class and add newline at end of file in rank.py --- src/lotto/main.py | 4 ++-- src/lotto/rank.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lotto/main.py b/src/lotto/main.py index a4eda7b..816d858 100644 --- a/src/lotto/main.py +++ b/src/lotto/main.py @@ -1,5 +1,5 @@ from lotto import Lotto -from lotto import Rank +from rank import Rank """ 로또 프로그램 모듈. 이 모듈은 로또 번호 생성, 당첨 확인, 결과 출력 등의 기능을 포함한다. @@ -141,4 +141,4 @@ def print_result(result, total_prize, count): if __name__ == "__main__": - main() + main() \ No newline at end of file diff --git a/src/lotto/rank.py b/src/lotto/rank.py index c617809..f1fbaa1 100644 --- a/src/lotto/rank.py +++ b/src/lotto/rank.py @@ -1,5 +1,6 @@ from enum import Enum + class Rank(Enum): """ 로또 당첨 순위 정의하는 클래스 @@ -28,4 +29,5 @@ def get_rank(cls, match_cnt, bonus): for rank in cls: if rank.match_cnt == match_cnt and rank.bonus_match == bonus: return rank - return cls.NONE \ No newline at end of file + return cls.NONE + \ No newline at end of file From 7533f2fed02096cb42e535a05359e5a6af5776a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=B1=EC=8A=B9=EC=9A=B0?= Date: Fri, 14 Feb 2025 00:20:44 +0900 Subject: [PATCH 3/6] Fix import statement for Rank class in main.py --- src/lotto/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lotto/main.py b/src/lotto/main.py index 816d858..48a4494 100644 --- a/src/lotto/main.py +++ b/src/lotto/main.py @@ -1,5 +1,5 @@ from lotto import Lotto -from rank import Rank +from lotto import Rank """ 로또 프로그램 모듈. 이 모듈은 로또 번호 생성, 당첨 확인, 결과 출력 등의 기능을 포함한다. From aa90fd81cceda5e249985bf2b4a108c8cbed8c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=B1=EC=8A=B9=EC=9A=B0?= Date: Fri, 14 Feb 2025 00:27:10 +0900 Subject: [PATCH 4/6] Consolidate import statements for Lotto and Rank classes and remove trailing newlines in main.py and rank.py --- src/lotto/main.py | 5 ++--- src/lotto/rank.py | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lotto/main.py b/src/lotto/main.py index 48a4494..da188e9 100644 --- a/src/lotto/main.py +++ b/src/lotto/main.py @@ -1,5 +1,4 @@ -from lotto import Lotto -from lotto import Rank +from lotto import Lotto, Rank """ 로또 프로그램 모듈. 이 모듈은 로또 번호 생성, 당첨 확인, 결과 출력 등의 기능을 포함한다. @@ -141,4 +140,4 @@ def print_result(result, total_prize, count): if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/src/lotto/rank.py b/src/lotto/rank.py index f1fbaa1..d838715 100644 --- a/src/lotto/rank.py +++ b/src/lotto/rank.py @@ -30,4 +30,3 @@ def get_rank(cls, match_cnt, bonus): if rank.match_cnt == match_cnt and rank.bonus_match == bonus: return rank return cls.NONE - \ No newline at end of file From 59330d28f6ae9edb0ff5e80993f1d5c15f64de29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=B1=EC=8A=B9=EC=9A=B0?= Date: Fri, 14 Feb 2025 00:33:42 +0900 Subject: [PATCH 5/6] Update __all__ in __init__.py to include Rank class --- src/lotto/__init__.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/lotto/__init__.py b/src/lotto/__init__.py index 48e68fb..ee498b4 100644 --- a/src/lotto/__init__.py +++ b/src/lotto/__init__.py @@ -1,19 +1,5 @@ -# 📌 이 패키지는 로또 관련 기능을 제공하는 모듈입니다. -# 외부에서 `from lotto import Lotto`와 같은 방식으로 사용할 수 있도록 -# 필요한 모듈을 여기에 등록하세요. -# -# ✅ 새로운 모듈을 추가할 경우: -# - `from .[모듈명] import [클래스/함수]` 형식으로 추가하세요. -# - 필요한 경우 `__all__`에 추가하여 패키지 외부에서 명확하게 사용할 수 있도록 정의하세요. -# - `flake8`의 F401 경고(`imported but unused`)가 발생하는 경우, `__all__`을 활용해 해결하세요. - from .lotto import Lotto # 🎲 로또 번호 생성 및 검증을 위한 클래스 from .rank import Rank # 🏆 로또 당첨 순위를 정의하는 Enum 클래스 # 패키지 외부에서 `from lotto import *` 사용 시 제공할 모듈을 명시적으로 정의합니다. -__all__ = ["Lotto"] -__all__.append("Rank") - -# 💡 예시: 새로운 모듈을 추가할 때 -# from .other_module import OtherClass # 🆕 예: 새로운 클래스 추가 시 -# __all__.append("OtherClass") # `__all__`에 추가하여 외부에서 접근 가능하게 함. +__all__ = ["Lotto", "Rank"] From ad1c187ab6679a9c6740d37715ea14c448cfe9cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=B1=EC=8A=B9=EC=9A=B0?= Date: Fri, 14 Feb 2025 00:38:36 +0900 Subject: [PATCH 6/6] Refactor import statements in main.py to separate Lotto and Rank classes --- src/lotto/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lotto/main.py b/src/lotto/main.py index da188e9..647798e 100644 --- a/src/lotto/main.py +++ b/src/lotto/main.py @@ -1,4 +1,5 @@ -from lotto import Lotto, Rank +from lotto import Lotto +from rank import Rank """ 로또 프로그램 모듈. 이 모듈은 로또 번호 생성, 당첨 확인, 결과 출력 등의 기능을 포함한다.