Skip to content

(이*호, 강의노트 3장) #51

@jonny070709

Description

@jonny070709

10의 자료형을 출력해보니 int가 나왔고,

print(type(10))

출력: <class 'int'>

int의 자료형을 알아보기 위해서 type(int)를 실행해보니,

print(type(int))

출력: <class 'type'>

type이라는 자료형이 나왔습니다. 그래서 type의 자료형을 알아보기 위해 type(type)을 실행해보니,

print(type(type))

출력: <class 'type'>

똑같이 type 이라는 결과가 출력되었습니다.

이것을 AI에게 물어보니 컴퓨터 프로그래밍 언어를 설계할 때, "모든 것에는 자료형(타입)이 있어야 한다"는 규칙을 세우면 마지막에 모순에 빠지게 된다.
이 끝없는 꼬리 물기를 끝내기 위해 파이썬 설계자들은 type을 "자기 자신을 정의하는 최상위 존재"로 만들었다고 알려주었습니다.

그렇다면 type이 자료형의 종점이라고 이해하면 될까요?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions