Some checks failed
Tests / Backend Tests (Python) (3.10) (push) Has been cancelled
Tests / Backend Tests (Python) (3.11) (push) Has been cancelled
Tests / Backend Tests (Python) (3.12) (push) Has been cancelled
Tests / Frontend Tests (JS) (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / All Tests Passed (push) Has been cancelled
10 lines
296 B
Python
10 lines
296 B
Python
from typing import Union
|
|
|
|
try:
|
|
print(f"Union[int, str]: {Union[int, str]}")
|
|
# Let's try what SQLAlchemy tries via casting
|
|
from typing import Any, cast
|
|
print(f"Casting and getting item: {cast(Any, Union)[int, str]}")
|
|
except Exception as e:
|
|
print(f"Normal indexing error: {e}")
|