Skip to Content
전문가를 위한 파이썬(2판)
book

전문가를 위한 파이썬(2판)

by 루시아누 하말류, 강권학
November 2024
Beginner to intermediate
1064 pages
25h 21m
Korean
Hanbit Media, Inc.
Content preview from 전문가를 위한 파이썬(2판)
594
3
클래스와 프로토콜
15
.
1
이번 장의 변경 사항
이 장은
2
판에 새로 추가되었다. 먼저 오버로드에 관해 알아보자.
15
.
2
오버로드된 시그너처
파이썬 함수가 다양하게 조합된 인수들을 받을 수 있다.
@typing.overload
데커레이터는 이
렇게 다양하게 조합된 인수를 어노테이트하게 해준다. 함수의 반환형이 두 개 이상의 매개변수
의 자료형에 따라 달라질 때 특히 중요하다.
내장 함수
sum( )
에 관해 알아보자.
help(sum )
이 출력한 도움말은 다음과 같다.
>>> help(sum)
sum(iterable, /, start=0)
Return the sum of a ‘start’ value (default: 0) plus an iterable of numbers
When the iterable is empty, return the start value.
This function is intended specifically for use with numeric values and may
reject non-numeric types.
내장 함수
sum( )
C
언어로 작성되었지만,
typeshed
builtins.pyi
에 이 함수에 대해 다
음과 같은 오버로드된 자료형 힌트를 정의한다.
@overload
def sum(__iterable: Iterable[_T]) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

전문가를 위한 리액트

전문가를 위한 리액트

테자스 쿠마르
고성능 파이썬(2판)

고성능 파이썬(2판)

오현석, 미샤 고렐릭, 이안 오스발트

Publisher Resources

ISBN: 9791169211772