1. Dictionary merge
>>> x | y
- type hint
from typing import Index, Dict
import 필요 없어짐
def hello(r: list[str]): for a in r: print(a)
3. 새로운 String Method
- removeprefix()
- removesuffix()
4. nextafter() 의 등장
math.nextafter(x,y) 로 구성되고, x → y 까지의 수 중 표현할 수 있는 다음 수를 리턴
5. 패키지 Import Error 버그 픽스
import()는 이제 ValueError 가 아닌 ImportError를 raise
6. 랜덤바이트 생성
andom.randbytes(?seed)
7. timezone error
>>> from datetime import datetime >>> from zoneinfo import ZoneInfo >>> utc = datetime.utcnow() >>> utc datetime.datetime(2020, 10, 12, 4, 24, 49, 297058) >>> kst = utc.astimezone(ZoneInfo('Asia/Seoul')) >>> kst datetime.datetime(2020, 10, 12, 4, 24, 49, 297058, tzinfo=zoneinfo.ZoneInfo(key='Asia/Seoul'))
8. gcd, lcm
>>> import math >>> math.gcd(2, 6, 8) 2 >>> math.lcm(2, 4, 6) 12
Python 3.9에 등장한 상큼한 8가지 Features
새로운 파이썬 버전이 나왔습니다. 파이썬에는 Node나 리눅스 처럼 딱히 LTS(Long Term Support) 버전이 이라 명명하는 버전이 없지만, RC(Release Candidate)에서 정식 버전 채택 후 18개월간의 수명을 가지며, 이 후 3년 6개월간 보안관련 업데이트를 지원합니다. 이 18개월의 시간을 Full Bugfix Support 기간이라 하며, 보통 동시에 2개 버전이 이 기간을 가지게 됩니다.
https://tech.madup.com/Python3.9/


Seonglae Cho