728x90
반응형
Error Message
TypeError: unsupported operand type(s) for |: 'type' and 'type'
Error Cause
'type' and 'type' syntax is only supported in 3.10 or later. Use
Example
## Error Code
def debug(msg: str | list):
print(msg)
## Right Code
def debug(msg: [str, list]):
print(msg)
debug("text")
728x90
반응형
'Programming > Python' 카테고리의 다른 글
ModuleNotFoundError: No module named 'Crypto' (0) | 2024.08.22 |
---|---|
[python]문자열에 double quotes 추가 하는 방법 (0) | 2024.06.19 |
Python Error: externally-managed-environment (0) | 2024.05.28 |
[Python]fatal error: 'longintrepr.h' file not found (0) | 2024.05.24 |
ModuleNotFoundError: No module named 'MySQLdb' (0) | 2024.05.20 |