Skip to content

(양*호, 강의노트 14장) 매직 메서드 #147

@qpq8xf

Description

@qpq8xf

강의 시간에 파이썬의 곱셈 연산은 기본적으로 왼쪽의 자료형이 오른쪽 자료형과의 연산 가능 여부를 먼저 판단하며, 그래서 문자열이 "123" * 2는 가능하지만 2 * "123"도 오류 없이 동작한다는 점을 잠시 설명해 주신 적이 있습니다.
이러한 동작 방식이 강의노트에 언급되어 있는 mul() 메서드와 rmul() 메서드의 동작 원리와도 연관이 있는 것인지 궁금합니다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions