You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
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
":class:`Rational` 의 하위 형이고 :class:`int` 클래스로 변환 기능이 추가됩니다. "
":func:`float`, :attr:`~Rational.numerator`, :attr:`~Rational.denominator` 를 "
"위한 기본값을 제공합니다. ``**`` 를 위한 메서드와 비트 연산 "
"``<<``, ``>>``, ``&``, ``^``, ``|``, ``~`` 를 추가합니다."
#: ../Doc/library/numbers.rst:84
msgid "Notes for type implementors"
msgstr ""
msgstr "형 구현을 위한 주의 사항"
#: ../Doc/library/numbers.rst:86
msgid ""
Expand All
@@ -117,21 +144,27 @@ msgid ""
"extensions of the real numbers. For example, :class:`fractions.Fraction` "
"implements :func:`hash` as follows::"
msgstr ""
"구현자는 동일한 숫자가 같게 취급되고 같은 값으로 해싱되도록 해야 합니다. "
"만약 종류가 다른 실수의 하위 형이 있는 경우 조금 까다로울 수 있습니다. "
"예를 들어 :class:`fractions.Fraction` 클래스는 :func:`hash` 함수를 다음과 같이 구현합니다::"
#: ../Doc/library/numbers.rst:105
msgid "Adding More Numeric ABCs"
msgstr ""
msgstr "더 많은 숫자 추상 베이스 클래스(ABC) 추가"
#: ../Doc/library/numbers.rst:107
msgid ""
"There are, of course, more possible ABCs for numbers, and this would be a"
" poor hierarchy if it precluded the possibility of adding those. You can "
"add ``MyFoo`` between :class:`Complex` and :class:`Real` with::"
msgstr ""
"물론 숫자를 위한 ABC를 추가하는 것이 가능합니다. "
"그렇지 않으면 엉망으로 상속 계층이 구현될 것입니다. "
":class:`Complex` 와 :class:`Real` 사이에 다음과 같이 ``MyFoo`` 를 추가할 수 있습니다::"
#: ../Doc/library/numbers.rst:119
msgid "Implementing the arithmetic operations"
msgstr ""
msgstr "산술 연산 구현"
#: ../Doc/library/numbers.rst:121
msgid ""
Expand All
@@ -141,6 +174,10 @@ msgid ""
" do the operation there. For subtypes of :class:`Integral`, this means "
"that :meth:`__add__` and :meth:`__radd__` should be defined as::"
msgstr ""
"다른 형에 대한 연산은 두 인자의 형에 관해 알고 있는 구현을 호출하거나 "
"두 인자를 가장 비슷한 내장 형으로 변환하여 연산을 하도록 산술 연산을 구현하는 것이 좋습니다. "
":class:`Integral` 클래스의 하위 형일 경우에 :meth:`__add__` 와 :meth:`__radd__` "
"메서드는 다음과 같이 정의되어야 함을 의미합니다::"
#: ../Doc/library/numbers.rst:152
msgid ""
Expand All
@@ -150,10 +187,14 @@ msgid ""
"will be an instance of ``A``, which is a subtype of :class:`Complex` (``a"
" : A <: Complex``), and ``b : B <: Complex``. I'll consider ``a + b``:"
msgstr ""
":class:`Complex` 클래스의 서브클래스에는 다섯 가지의 서로 다른 혼합 형 연산이 있습니다. "
"위의 코드에서 ``MyIntegral`` 와 ``OtherTypeIKnowAbout`` 를 제외한 나머지를 기본구조라고 하겠습니다. "
"``a`` 는 :class:`Complex` 의 하위 형인 ``A`` 의 인스턴스입니다(즉 ``a : A <: Complex`` 입니다). "
"비슷하게 ``b : B <: Complex`` 입니다. ``a + b`` 인 경우를 생각해 보겠습니다:"
#: ../Doc/library/numbers.rst:159
msgid "If ``A`` defines an :meth:`__add__` which accepts ``b``, all is well."
msgstr ""
msgstr "만약 ``A`` 가 ``b`` 를 받는 :meth:`__add__` 메서드를 정의했다면 모든 것이 문제없이 처리됩니다."
#: ../Doc/library/numbers.rst:161
msgid ""
Expand All
@@ -163,25 +204,36 @@ msgid ""
":const:`NotImplemented` from :meth:`__add__`. (Or ``A`` may not implement"
" :meth:`__add__` at all.)"
msgstr ""
"``A`` 가 기본구조 코드로 진입하고 :meth:`__add__` 로부터 어떤 값을 반환한다면 "
"``B`` 가 똑똑하게 정의한 :meth:`__radd__` 메서드를 놓칠 수 있습니다. "
"이를 피하려면 기본구조는 :meth:`__add__` 에서 :const:`NotImplemented` 를 반환해야 합니다. "
"(또는 ``A`` 가 :meth:`__add__` 메서드를 전혀 구현하지 않을 수도 있습니다.)"
#: ../Doc/library/numbers.rst:167
msgid ""
"Then ``B``'s :meth:`__radd__` gets a chance. If it accepts ``a``, all is "
"well."
msgstr ""
"그다음 ``B`` 의 :meth:`__radd__` 메서드가 기회를 얻습니다. "
"이 메서드가 ``a`` 를 받을 수 있다면 모든 것이 문제 없이 처리됩니다."
#: ../Doc/library/numbers.rst:169
msgid ""
"If it falls back to the boilerplate, there are no more possible methods "
"to try, so this is where the default implementation should live."
msgstr ""
"기본구조 코드로 돌아온다면 더 이상 시도해 볼 수 있는 메서드가 없기 때문에 "
"기본적으로 수행될 구현을 작성해야 합니다."
#: ../Doc/library/numbers.rst:172
msgid ""
"If ``B <: A``, Python tries ``B.__radd__`` before ``A.__add__``. This is "
"ok, because it was implemented with knowledge of ``A``, so it can handle "
"those instances before delegating to :class:`Complex`."
msgstr ""
"만약 ``B <: A`` 라면 파이썬은 ``A.__add__`` 메서드 전에 ``B.__radd__`` 를 시도합니다. "
"``A`` 에 대해서 알고 ``B`` 가 구현되었기 때문에 이런 행동은 문제없습니다. "
"따라서 :class:`Complex` 에 위임하기 전에 이 인스턴스를 처리할 수 있습니다."
#: ../Doc/library/numbers.rst:177
msgid ""
Expand All
@@ -190,6 +242,9 @@ msgid ""
" built in :class:`complex`, and both :meth:`__radd__` s land there, so "
"``a+b == b+a``."
msgstr ""
"만약 어떤 것도 공유하지 않는 ``A <: Complex`` 와 ``B <: Real`` 라면 "
"적절한 공유 연산(shared operation)은 내장 :class:`complex` 클래스에 연관된 것입니다. "
"양쪽의 :meth:`__radd__` 메서드가 여기에 해당하므로 ``a+b == b+a`` 가 됩니다."
#: ../Doc/library/numbers.rst:182
msgid ""
Expand All
@@ -198,4 +253,6 @@ msgid ""
"and reverse instances of any given operator. For example, "
":class:`fractions.Fraction` uses::"
msgstr ""
"대부분 주어진 어떤 형에 대한 연산은 매우 비슷하기 때문에, "
"주어진 연산의 정방향(forward) 인스턴스와 역방향(reverse) 인스턴스를 생성하는 헬퍼 함수를 정의하는 것이 유용합니다. "
"예를 들어 :class:`fractions.Fraction` 클래스는 다음과 같이 사용합니다::"
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.