Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
save()에 몰려 있어 반환 타입과 사용 의도가 불명확해 이를 명확히 분리하려는 목적입니다.save()제거 시 전환을 용이하게 하려는 의도입니다.Description
HwpxDocument에save_to_path(path) -> str | PathLike[str],save_to_stream(stream) -> BinaryIO,to_bytes() -> bytes메서드를 추가해 경로 저장, 스트림 저장, 바이트 반환 시나리오를 분리했습니다.save()는 하위 호환용 래퍼로 유지하되typing.overload로 시그니처를 명확히 하고 호출 시DeprecationWarning을 발생시키며 내부에서 새 메서드로 위임하도록 변경했습니다.self._root.serialize()와HwpxPackage.save()호출을 분리하여 각 반환 타입 요구사항을 처리합니다.README.md와docs/api_reference.md에 새 반환 타입 안내와 deprecation 가이드를 반영했습니다.Testing
tests/test_document_save_api.py를 추가했고 기존 컨텍스트 매니저 테스트(tests/test_document_context_manager.py)와 함께 실행했습니다.pytest -q tests/test_document_save_api.py tests/test_document_context_manager.py명령을 실행한 결과7 passed(및 1개의 DeprecationWarning)이 보고되었습니다.Codex Task