Skip to content

dump_contexts_to_log: runs-on: ubuntu-24.04 #233

dump_contexts_to_log: runs-on: ubuntu-24.04

dump_contexts_to_log: runs-on: ubuntu-24.04 #233

name: type_hint_test
on: [push]
env:
CODE: "def func(x: str | None) -> None: pas"
jobs:
type_hint_test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: |
3.7
3.8
3.9
3.10
3.11
- env:
OLD: "type(1) is int"
NEW: "isinstance(1, int)"
run: |
python3.7 -m timeit "$OLD"
python3.7 -m timeit "$NEW"
python3.8 -m timeit "$OLD"
python3.8 -m timeit "$NEW"
python3.9 -m timeit "$OLD"
python3.9 -m timeit "$NEW"
python3.10 -m timeit "$OLD"
python3.10 -m timeit "$NEW"
python3.11 -m timeit "$OLD"
python3.11 -m timeit "$NEW"
- run: python3.11 -c "$CODE"
- run: python3.10 -c "$CODE"
- run: python3.9 -c "$CODE"
- run: python3.8 -c "$CODE"
- run: python3.7 -c "$CODE"