nixbot

builds
1structuredAttrs is enabled2Using versionCheckHook
unpackPhase
3unpacking source archive /nix/store/wq39qi1cqbdvd6kcdlmhik726m6f0d9x-source4source root is source5Executing cargoSetupPostUnpackHook6Finished cargoSetupPostUnpackHook
patchPhase
7Executing cargoSetupPostPatchHook8Validating consistency between /build/source/ruff/Cargo.lock and /build/ty-0.0.38-vendor/Cargo.lock9Finished cargoSetupPostPatchHook
buildPhase
10Executing cargoBuildHook11/build/source/ruff /build/source12cargoBuildHook flags: -j 4 --target aarch64-unknown-linux-gnu --offline --profile release --package=ty13 Compiling proc-macro2 v1.0.10614 Compiling unicode-ident v1.0.2415 Compiling quote v1.0.4516 Compiling libc v0.2.18617 Compiling cfg-if v1.0.318 Compiling memchr v2.8.019 Compiling syn v2.0.11720 Compiling serde_core v1.0.22821 Compiling autocfg v1.5.022 Compiling smallvec v1.15.123 Compiling serde v1.0.22824 Compiling jobserver v0.1.3425 Compiling proc-macro-utils v0.10.026 Compiling find-msvc-tools v0.1.227 Compiling shlex v1.3.028 Compiling cc v1.2.3829 Compiling crossbeam-utils v0.8.2130 Compiling rustversion v1.0.2231 Compiling itoa v1.0.1532 Compiling heck v0.5.033 Compiling foldhash v0.2.034 Compiling equivalent v1.0.235 Compiling zerocopy v0.8.2736 Compiling allocator-api2 v0.2.2137 Compiling bitflags v2.11.138 Compiling hashbrown v0.17.039 Compiling synstructure v0.13.240 Compiling manyhow-macros v0.11.441 Compiling indexmap v2.14.042 Compiling manyhow v0.11.443 Compiling getrandom v0.2.1644 Compiling interpolator v0.5.045 Compiling collection_literals v1.0.246 Compiling rand_core v0.6.447 Compiling castaway v0.2.448 Compiling once_cell v1.21.349 Compiling ryu v1.0.2050 Compiling pkg-config v0.3.3251 Compiling static_assertions v1.1.052 Compiling ordermap v1.2.053 Compiling serde_derive v1.0.22854 Compiling quote-use-macros v0.8.455 Compiling derive-where v1.6.056 Compiling quote-use v0.8.457 Compiling attribute-derive-macro v0.10.358 Compiling ppv-lite86 v0.2.2159 Compiling rand_chacha v0.3.160 Compiling zstd-sys v2.0.16+zstd.1.5.761 Compiling aho-corasick v1.1.462 Compiling attribute-derive v0.10.363 Compiling regex-syntax v0.8.1064 Compiling siphasher v1.0.165 Compiling phf_shared v0.11.366 Compiling get-size-derive2 v0.8.067 Compiling rand v0.8.568 Compiling compact_str v0.9.069 Compiling regex-automata v0.4.1470 Compiling phf_generator v0.11.371 Compiling zerofrom-derive v0.1.672 Compiling get-size2 v0.8.073 Compiling phf_codegen v0.11.374 Compiling yoke-derive v0.8.275 Compiling zerofrom v0.1.676 Compiling lock_api v0.4.1377 Compiling log v0.4.2978 Compiling stable_deref_trait v1.2.079 Compiling parking_lot_core v0.9.1180 Compiling tracing-attributes v0.1.3181 Compiling tracing-core v0.1.3682 Compiling yoke v0.8.283 Compiling memoffset v0.9.184 Compiling portable-atomic v1.13.185 Compiling either v1.15.086 Compiling thiserror v2.0.1887 Compiling zstd-safe v5.0.2+zstd.1.5.288 Compiling pin-project-lite v0.2.1689 Compiling scopeguard v1.2.090 Compiling ruff_text_size v0.0.0 (/build/source/ruff/crates/ruff_text_size)91 Compiling tracing v0.1.4492 Compiling thiserror-impl v2.0.1893 Compiling zerovec-derive v0.11.394 Compiling typeid v1.0.395 Compiling foldhash v0.1.596 Compiling crc32fast v1.5.097 Compiling hashbrown v0.15.598 Compiling zerovec v0.11.699 Compiling bstr v1.12.1100 Compiling itertools v0.14.0101 Compiling displaydoc v0.2.5102 Compiling crossbeam-queue v0.3.12103 Compiling unicode-width v0.2.2104 Compiling getopts v0.2.24105 Compiling globset v0.4.18106 Compiling intrusive-collections v0.9.7107 Compiling hashlink v0.10.0108 Compiling ruff_source_file v0.0.0 (/build/source/ruff/crates/ruff_source_file)109 Compiling parking_lot v0.12.4110 Compiling is-macro v0.3.7111 Compiling salsa-macros v0.26.2112 Compiling anstyle v1.0.14113 Compiling getrandom v0.4.2114 Compiling inventory v0.3.24115 Compiling rand_core v0.10.0116 Compiling rustc-hash v2.1.2117 Compiling salsa-macro-rules v0.26.2118 Compiling boxcar v0.2.14119 Compiling thin-vec v0.2.14120 Compiling zmij v1.0.10121 Compiling unicode_names2_generator v1.3.0122 Compiling phf v0.11.3123 Compiling regex v1.12.3124 Compiling filetime v0.2.27125 Compiling num-traits v0.2.19126 Compiling seahash v4.1.0127 Compiling ident_case v1.0.1128 Compiling strsim v0.11.1129 Compiling glob v0.3.3130 Compiling serde_json v1.0.149131 Compiling salsa v0.26.2132 Compiling ruff_cache v0.0.0 (/build/source/ruff/crates/ruff_cache)133 Compiling darling_core v0.23.0134 Compiling unicode_names2 v1.3.0135 Compiling ruff_python_trivia v0.0.0 (/build/source/ruff/crates/ruff_python_trivia)136 Compiling chacha20 v0.10.0137 Compiling tinystr v0.8.3138 Compiling crossbeam-epoch v0.9.18139 Compiling litemap v0.8.0140 Compiling writeable v0.6.2141 Compiling tinyvec_macros v0.1.1142 Compiling tinyvec v1.10.0143 Compiling darling_macro v0.23.0144 Compiling icu_locale_core v2.2.0145 Compiling crossbeam-deque v0.8.6146 Compiling ruff_python_ast v0.0.0 (/build/source/ruff/crates/ruff_python_ast)147 Compiling rand v0.10.1148 Compiling zerotrie v0.2.4149 Compiling potential_utf v0.1.3150 Compiling anyhow v1.0.102151 Compiling icu_properties_data v2.2.0152 Compiling iana-time-zone v0.1.64153 Compiling utf8_iter v1.0.4154 Compiling icu_collections v2.2.0155 Compiling chrono v0.4.44156 Compiling icu_provider v2.2.0157 Compiling uuid v1.23.1158 Compiling darling v0.23.0159 Compiling unicode-normalization v0.1.24160 Compiling same-file v1.0.6161 Compiling walkdir v2.5.0162 Compiling ruff_python_parser v0.0.0 (/build/source/ruff/crates/ruff_python_parser)163 Compiling ruff_macros v0.0.0 (/build/source/ruff/crates/ruff_macros)164 Compiling serde_with_macros v3.19.0165 Compiling ruff_diagnostics v0.0.0 (/build/source/ruff/crates/ruff_diagnostics)166 Compiling vte v0.14.1167 Compiling camino v1.2.2168 Compiling strip-ansi-escapes v0.2.1169 Compiling icu_properties v2.2.0170 Compiling serde_with v3.19.0171 Compiling newtype-uuid v1.3.2172 Compiling which v8.0.2173 Compiling quick-xml v0.38.4174 Compiling adler2 v2.0.1175 Compiling byteorder v1.5.0176 Compiling hashbrown v0.14.5177 Compiling dashmap v6.1.0178 Compiling quick-junit v0.6.0179 Compiling miniz_oxide v0.8.9180 Compiling ruff_notebook v0.0.0 (/build/source/ruff/crates/ruff_notebook)181 Compiling ty_static v0.0.1 (/build/source/ruff/crates/ty_static)182 Compiling ignore v0.4.25183 Compiling ruff_annotate_snippets v0.1.0 (/build/source/ruff/crates/ruff_annotate_snippets)184 Compiling ruff_memory_usage v0.0.0 (/build/source/ruff/crates/ruff_memory_usage)185 Compiling arc-swap v1.9.1186 Compiling etcetera v0.11.0187 Compiling dunce v1.0.5188 Compiling supports-hyperlinks v3.2.0189 Compiling path-slash v0.2.1190 Compiling pathdiff v0.2.3191 Compiling matchit v0.9.2192 Compiling similar v3.1.0193 Compiling zstd v0.11.2+zstd.1.5.2194 Compiling flate2 v1.1.2195 Compiling zip v0.6.6196 Compiling strum_macros v0.28.0197 Compiling radium v0.7.0198 Compiling ref-cast v1.0.25199 Compiling icu_normalizer_data v2.2.0200 Compiling rustix v1.1.4201 Compiling ty_vendored v0.0.0 (/build/source/ruff/crates/ty_vendored)202 Compiling ref-cast-impl v1.0.25203 Compiling strum v0.28.0204 Compiling serde_derive_internals v0.29.1205 Compiling tap v1.0.1206 Compiling linux-raw-sys v0.12.1207 Compiling rayon-core v1.13.0208 Compiling utf8parse v0.2.2209 Compiling anstyle-parse v1.0.0210 Compiling wyz v0.5.1211 Compiling schemars_derive v1.2.1212 Compiling ruff_python_literal v0.0.0 (/build/source/ruff/crates/ruff_python_literal)213 Compiling ruff_python_stdlib v0.0.0 (/build/source/ruff/crates/ruff_python_stdlib)214 Compiling is_terminal_polyfill v1.70.1215 Compiling option-ext v0.2.0216 Compiling colored v3.1.1217 Compiling dyn-clone v1.0.20218 Compiling colorchoice v1.0.4219 Compiling anstyle-query v1.1.4220 Compiling funty v2.0.0221 Compiling schemars v1.2.1222 Compiling anstream v1.0.0223 Compiling bitvec v1.0.1224 Compiling dirs-sys v0.5.0225 Compiling terminal_size v0.4.3226 Compiling icu_normalizer v2.2.0227 Compiling ruff_index v0.0.0 (/build/source/ruff/crates/ruff_index)228 Compiling crossbeam-channel v0.5.15229 Compiling inotify-sys v0.1.5230 Compiling cfg_aliases v0.2.1231 Compiling clap_lex v1.0.0232 Compiling winnow v1.0.0233 Compiling clap_builder v4.6.0234 Compiling nix v0.31.2235 Compiling inotify v0.11.0236 Compiling toml_parser v1.1.2+spec-1.1.0237 Compiling rayon v1.12.0238 Compiling idna_adapter v1.2.1239 Compiling dirs v6.0.0240 Compiling mio v1.0.4241 Compiling clap_derive v4.6.1242 Compiling toml_datetime v1.1.1+spec-1.1.0243 Compiling serde_spanned v1.1.1244 Compiling version-ranges v0.1.1245 Compiling toml_writer v1.1.1+spec-1.1.0246 Compiling lazy_static v1.5.0247 Compiling drop_bomb v0.1.5248 Compiling notify-types v2.0.0249 Compiling unscanny v0.1.0250 Compiling percent-encoding v2.3.2251 Compiling pep440_rs v0.7.3252 Compiling form_urlencoded v1.2.2253 Compiling notify v8.2.0254 Compiling sharded-slab v0.1.7255 Compiling toml v1.1.2+spec-1.1.0256 Compiling clap v4.6.1257 Compiling shellexpand v3.1.2258 Compiling idna v1.1.0259 Compiling crossbeam v0.8.4260 Compiling ruff_python_codegen v0.0.0 (/build/source/ruff/crates/ruff_python_codegen)261 Compiling matchers v0.2.0262 Compiling terminfo v0.9.0263 Compiling tikv-jemalloc-sys v0.6.1+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7264 Compiling fs-err v3.3.0265 Compiling thread_local v1.1.9266 Compiling nu-ansi-term v0.50.1267 Compiling minimal-lexical v0.2.1268 Compiling ruff_options_metadata v0.0.0 (/build/source/ruff/crates/ruff_options_metadata)269 Compiling nom v7.1.3270 Compiling tracing-subscriber v0.3.23271 Compiling ruff_python_importer v0.0.0 (/build/source/ruff/crates/ruff_python_importer)272 Compiling url v2.5.8273 Compiling ruff_db v0.0.0 (/build/source/ruff/crates/ruff_db)274 Compiling clap_complete v4.5.58275 Compiling serde_repr v0.1.20276 Compiling bitflags v1.3.2277 Compiling fnv v1.0.7278 Compiling lsp-types v0.95.1 (https://github.com/astral-sh/lsp-types.git?rev=e15db0593f0ecbbd80599c3f5880e4bf5da1ca0c#e15db059)279 Compiling ty_site_packages v0.0.0 (/build/source/ruff/crates/ty_site_packages)280 Compiling ty_module_resolver v0.0.0 (/build/source/ruff/crates/ty_module_resolver)281 Compiling ty_combine v0.0.0 (/build/source/ruff/crates/ty_combine)282 Compiling ty_python_core v0.0.0 (/build/source/ruff/crates/ty_python_core)283 Compiling ty_python_semantic v0.0.0 (/build/source/ruff/crates/ty_python_semantic)284 Compiling clap_complete_nushell v4.5.8285 Compiling lsp-server v0.7.9286 Compiling console v0.16.1287 Compiling os_str_bytes v7.1.1288 Compiling ty v0.0.0 (/build/source/ruff/crates/ty)289 Compiling unit-prefix v0.5.1290 Compiling jod-thread v1.0.0291 Compiling indicatif v0.18.4292 Compiling argfile v1.0.0293 Compiling tikv-jemallocator v0.6.1294 Compiling clap_complete_command v0.6.1295 Compiling clearscreen v4.0.6296 Compiling ctrlc v3.5.2297 Compiling tracing-flame v0.2.0298 Compiling wild v2.2.1299 Compiling jiff v0.2.24300 Compiling ty_project v0.0.0 (/build/source/ruff/crates/ty_project)301 Compiling ty_ide v0.0.0 (/build/source/ruff/crates/ty_ide)302 Compiling ty_server v0.0.0 (/build/source/ruff/crates/ty_server)303 Finished `release` profile [optimized] target(s) in 13m 42s304/build/source305Executing cargoInstallPostBuildHook306Finished cargoInstallPostBuildHook307Finished cargoBuildHook308buildPhase completed in 13 minutes 43 seconds
checkPhase
309Executing cargoCheckHook310/build/source/ruff /build/source311cargoCheckHook flags: -j 4 --profile release --target aarch64-unknown-linux-gnu --offline --package=ty --package=ty_python_semantic --package=ty_test -- --skip=python_environment::ty_environment_and_active_environment --skip=python_environment::ty_environment_and_discovered_venv --skip=python_environment::ty_environment_is_only_environment --skip=python_environment::ty_environment_is_system_not_virtual --skip=python_environment::ty_system_environment_and_local_venv --skip=mdtest::generics/pep695/functions.md312 Compiling rustix v1.1.4313 Compiling ruff_db v0.0.0 (/build/source/ruff/crates/ruff_db)314 Compiling fastrand v2.3.0315 Compiling similar v2.7.0316 Compiling anstyle-parse v0.2.7317 Compiling bit-vec v0.8.0318 Compiling rustc-stable-hash v0.1.2319 Compiling bit-set v0.8.0320 Compiling anstream v0.6.21321 Compiling test-case-core v3.3.1322 Compiling escape8259 v0.5.3323 Compiling fancy-regex v0.14.0324 Compiling test-case-macros v3.3.1325 Compiling yansi v1.0.1326 Compiling ty_combine v0.0.0 (/build/source/ruff/crates/ty_combine)327 Compiling ty_module_resolver v0.0.0 (/build/source/ruff/crates/ty_module_resolver)328 Compiling ty_vendored v0.0.0 (/build/source/ruff/crates/ty_vendored)329 Compiling ty_site_packages v0.0.0 (/build/source/ruff/crates/ty_site_packages)330 Compiling terminal_size v0.4.3331 Compiling clap_builder v4.6.0332 Compiling tempfile v3.27.0333 Compiling ty_python_core v0.0.0 (/build/source/ruff/crates/ty_python_core)334 Compiling ty_python_semantic v0.0.0 (/build/source/ruff/crates/ty_python_semantic)335 Compiling clap v4.6.1336 Compiling insta v1.47.2337 Compiling clap_complete v4.5.58338 Compiling clap_complete_nushell v4.5.8339 Compiling clap_complete_command v0.6.1340 Compiling mdtest v0.0.0 (/build/source/ruff/crates/mdtest)341 Compiling libtest-mimic v0.8.1342 Compiling diff v0.1.13343 Compiling pretty_assertions v1.4.1344 Compiling datatest-stable v0.3.3345 Compiling insta-cmd v0.6.0346 Compiling test-case v3.3.1347 Compiling quickcheck v1.1.0348 Compiling quickcheck_macros v1.2.0349 Compiling indoc v2.0.7350 Compiling ty_project v0.0.0 (/build/source/ruff/crates/ty_project)351 Compiling ty_test v0.0.0 (/build/source/ruff/crates/ty_test)352 Compiling ty_ide v0.0.0 (/build/source/ruff/crates/ty_ide)353 Compiling ty_server v0.0.0 (/build/source/ruff/crates/ty_server)354 Compiling ty v0.0.0 (/build/source/ruff/crates/ty)355 Finished `release` profile [optimized] target(s) in 19m 11s356 Running unittests src/lib.rs (/build/source/target/aarch64-unknown-linux-gnu/release/deps/ty-c4933f3981498ae6)357358running 4 tests359test version::tests::version_formatting ... ok360test version::tests::version_formatting_with_commits_since_last_tag ... ok361test version::tests::version_serializable ... ok362test version::tests::version_formatting_with_commit_info ... ok363364test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.05s365366 Running unittests src/main.rs (/build/source/target/aarch64-unknown-linux-gnu/release/deps/ty-047443a7f6cf150e)367368running 0 tests369370test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s371372 Running tests/cli/main.rs (/build/source/target/aarch64-unknown-linux-gnu/release/deps/cli-c2d9d8e3a3a1eb50)373374running 123 tests375test analysis_options::overrides_precedence ... ok376test analysis_options::overrides_inherit_global ... ok377test analysis_options::overrides_basic ... ok378test check_file_without_extension_in_subfolder ... ok379test check_non_existing_path ... ok380test check_file_without_extension ... ok381test analysis_options::respect_type_ignore_comments_is_turned_off ... ok382test can_handle_large_binop_expressions ... ok383test concise_diagnostics ... ok384test concise_revealed_type ... ok385test config_option::cli_config_args_invalid_option ... ok386test check_specific_paths ... ok387test cli_arguments_are_relative_to_the_current_directory ... ok388test config_option::cli_config_args_later_overrides_earlier ... ok389test exit_code::both_warnings_and_errors ... ok390test config_option::cli_config_args_overrides_ty_toml ... ok391test config_option::cli_config_args_toml_string_basic ... ok392test exit_code::no_errors_but_error_on_warning_is_enabled_in_configuration ... ok393test config_option::config_file_override ... ok394test exit_code::exit_zero_is_true ... ok395test exit_code::both_warnings_and_errors_and_error_on_warning_is_true ... ok396test exit_code::only_info_and_error_on_warning_is_true ... ok397test exit_code::only_info ... ok398test exit_code::no_errors_but_error_on_warning_is_true ... ok399test exit_code::only_warnings ... ok400test file_selection::cli_and_configuration_exclude ... ok401test file_selection::bazel_symlinked_files ... ok402test file_selection::cli_removes_config_exclude ... ok403test file_selection::configuration_exclude ... ok404test file_selection::configuration_include_no_extension ... ok405test file_selection::exclude_argument_precedence_include_argument ... ok406test file_selection::configuration_include ... ok407test file_selection::exclude_argument ... ok408test file_selection::exclude_precedence_over_include ... ok409test file_selection::force_exclude_directory_exclusion ... ok410test file_selection::invalid_exclude_pattern ... ok411test file_selection::invalid_include_pattern ... ok412test file_selection::exclude_symlink_source_not_target ... ok413test file_selection::invalid_include_pattern_concise_output ... ok414test file_selection::explicit_path_overrides_exclude ... ok415test file_selection::explicit_path_overrides_exclude_force_exclude ... ok416test fixes::add_ignore_unfixable ... ok417test file_selection::remove_default_exclude ... ok418test fixes::add_ignore ... ok419Snapshot test passes but the existing value is in a legacy format. Please run `cargo insta test --force-update-snapshots` to update to a newer format. Snapshot contents:420 x = 1421test fixes::fix ... ok422test fixes::fix_clean_file ... ok423Snapshot test passes but the existing value is in a legacy format. Please run `cargo insta test --force-update-snapshots` to update to a newer format. Snapshot contents:424 x = 1425test fixes::fix_unfixable ... ok426test gitlab_empty_diagnostics ... ok427test github_diagnostics ... ok428test gitlab_diagnostics ... ok429test python_environment::cli_unsupported_python_version ... ok430test paths_in_configuration_files_are_relative_to_the_project_root ... ok431test python_environment::config_file_annotation_showing_where_python_version_set_syntax_error ... ok432test python_environment::config_file_broken_python_setting ... ok433test python_environment::config_file_python_setting_directory_with_no_site_packages ... ok434test python_environment::config_file_annotation_showing_where_python_version_set_typing_error ... ok435test python_environment::config_file_python_setting_directory_with_unsupported_python_version ... ok436test python_environment::config_file_unsupported_python_version ... ok437test python_environment::config_override_python_version ... ok438test python_environment::config_override_python_platform ... ok439test python_environment::default_root_flat_layout ... ok440test python_environment::default_root_flat_layout_variant ... ok441test python_environment::check_venv_resolution_without_working_venv ... ok442test python_environment::check_venv_resolution_with_working_venv ... ok443test python_environment::default_root_project_name_folder ... ok444test python_environment::default_root_python_package ... ok445test python_environment::default_root_python_folder ... ok446test python_environment::default_root_python_package_pyi ... ok447test python_environment::default_root_tests_package ... ok448test python_environment::default_root_src_layout ... ok449test python_environment::default_root_tests_folder ... ok450test python_environment::environment_root_takes_precedence_over_src_root ... ok451test python_environment::missing_virtual_env ... ok452test python_environment::lib64_site_packages_directory_on_unix ... ok453test python_environment::python_argument_points_to_symlinked_executable ... ok454test python_environment::many_search_paths ... ok455test python_environment::python_cli_argument_system_installation ... ok456test python_environment::python_cli_argument_virtual_environment ... ok457test python_environment::python_argument_trapped_in_a_symlink_factory ... ok458test python_environment::defaults_to_a_new_python_version ... ok459test python_environment::pyvenv_cfg_file_annotation_no_trailing_newline ... ok460test python_environment::python_version_inferred_from_system_installation ... ok461test python_environment::pythonpath_is_respected ... ok462test python_environment::pythonpath_multiple_dirs_is_respected ... ok463test python_environment::pyvenv_cfg_file_annotation_showing_where_python_version_set ... ok464test python_environment::src_root_deprecation_warning ... ok465test python_environment::src_root_deprecation_warning_with_environment_root ... ok466test python_environment::unix_system_installation_with_no_lib_directory ... ok467test python_environment::src_subdirectory_takes_precedence_over_repo_root ... ok468# abstract-method-in-final-class469470Default level: error | Stable (since 0.0.13)471472## What it does473Checks for `@final` classes that have unimplemented abstract methods.474475## Why is this bad?476A class decorated with `@final` cannot be subclassed. If such a class has abstract477methods that are not implemented, the class can never be properly instantiated, as478the abstract methods can never be implemented (since subclassing is prohibited).479480At runtime, instantiation of classes with unimplemented abstract methods is only481prevented for classes that have `ABCMeta` (or a subclass of it) as their metaclass.482However, type checkers also enforce this for classes that do not use `ABCMeta`, since483the intent for the class to be abstract is clear from the use of `@abstractmethod`.484485## Example486487```python488from abc import ABC, abstractmethod489from typing import final490491class Base(ABC):492 @abstractmethod493 def method(self) -> int: ...494495@final496class Derived(Base): # Error: `Derived` does not implement `method`497 pass498```499500# ambiguous-protocol-member501502Default level: warn | Stable (since 0.0.1-alpha.20)503504## What it does505Checks for protocol classes with members that will lead to ambiguous interfaces.506507## Why is this bad?508Assigning to an undeclared variable in a protocol class leads to an ambiguous509interface which may lead to the type checker inferring unexpected things. It's510recommended to ensure that all members of a protocol class are explicitly declared.511512## Examples513514```py515from typing import Protocol516517class BaseProto(Protocol):518 a: int # fine (explicitly declared as `int`)519 def method_member(self) -> int: ... # fine: a method definition using `def` is considered a declaration520 c = "some variable" # error: no explicit declaration, leading to ambiguity521 b = method_member # error: no explicit declaration, leading to ambiguity522523 # error: this creates implicit assignments of `d` and `e` in the protocol class body.524 # Were they really meant to be considered protocol members?525 for d, e in enumerate(range(42)):526 pass527528class SubProto(BaseProto, Protocol):529 a = 42 # fine (declared in superclass)530```531532# assert-type-unspellable-subtype533534Default level: error | Stable (since 0.0.14)535536## What it does537Checks for `assert_type()` calls where the actual type538is an unspellable subtype of the asserted type.539540## Why is this bad?541`assert_type()` is intended to ensure that the inferred type of a value542is exactly the same as the asserted type. But in some situations, ty543has nonstandard extensions to the type system that allow it to infer544more precise types than can be expressed in user annotations. ty emits a545different error code to `type-assertion-failure` in these situations so546that users can easily differentiate between the two cases.547548## Example549550```python551def _(x: int):552 assert_type(x, int) # fine553 if x:554 assert_type(x, int) # error: [assert-type-unspellable-subtype]555 # the actual type is `int & ~AlwaysFalsy`,556 # which excludes types like `Literal[0]`557```558559# call-abstract-method560561Default level: error | Preview (since 0.0.16)562563## What it does564Checks for calls to abstract `@classmethod`s or `@staticmethod`s565with "trivial bodies" when accessed on the class object itself.566567"Trivial bodies" are bodies that solely consist of `...`, `pass`,568a docstring, and/or `raise NotImplementedError`.569570## Why is this bad?571An abstract method with a trivial body has no concrete implementation572to execute, so calling such a method directly on the class will probably573not have the desired effect.574575It is also unsound to call these methods directly on the class. Unlike576other methods, ty permits abstract methods with trivial bodies to have577non-`None` return types even though they always return `None` at runtime.578This is because it is expected that these methods will always be579overridden rather than being called directly. As a result of this580exception to the normal rule, ty may infer an incorrect type if one of581these methods is called directly, which may then mean that type errors582elsewhere in your code go undetected by ty.583584Calling abstract classmethods or staticmethods via `type[X]` is allowed,585since the actual runtime type could be a concrete subclass with an implementation.586587## Example588```python589from abc import ABC, abstractmethod590591class Foo(ABC):592 @classmethod593 @abstractmethod594 def method(cls) -> int: ...595596Foo.method() # Error: cannot call abstract classmethod597```598599# call-non-callable600601Default level: error | Stable (since 0.0.1-alpha.1)602603## What it does604Checks for calls to non-callable objects.605606## Why is this bad?607Calling a non-callable object will raise a `TypeError` at runtime.608609## Examples610```python6114() # TypeError: 'int' object is not callable612```613614# call-top-callable615616Default level: error | Stable (since 0.0.7)617618## What it does619Checks for calls to objects typed as `Top[Callable[..., T]]` (the infinite union of all620callable types with return type `T`).621622## Why is this bad?623When an object is narrowed to `Top[Callable[..., object]]` (e.g., via `callable(x)` or624`isinstance(x, Callable)`), we know the object is callable, but we don't know its625precise signature. This type represents the set of all possible callable types626(including, e.g., functions that take no arguments and functions that require arguments),627so no specific set of arguments can be guaranteed to be valid.628629## Examples630```python631def f(x: object):632 if callable(x):633 x() # error: We know `x` is callable, but not what arguments it accepts634```635636# conflicting-argument-forms637638Default level: error | Stable (since 0.0.1-alpha.1)639640## What it does641Checks whether an argument is used as both a value and a type form in a call.642643## Why is this bad?644Such calls have confusing semantics and often indicate a logic error.645646## Examples647```python648from typing import reveal_type649from ty_extensions import is_singleton650651if flag:652 f = repr # Expects a value653else:654 f = is_singleton # Expects a type form655656f(int) # error657```658659# conflicting-declarations660661Default level: error | Stable (since 0.0.1-alpha.1)662663## What it does664Checks whether a variable has been declared as two conflicting types.665666## Why is this bad667A variable with two conflicting declarations likely indicates a mistake.668Moreover, it could lead to incorrect or ill-defined type inference for669other code that relies on these variables.670671## Examples672```python673if b:674 a: int675else:676 a: str677678a = 1679```680681# conflicting-metaclass682683Default level: error | Stable (since 0.0.1-alpha.1)684685## What it does686Checks for class definitions where the metaclass of the class687being created would not be a subclass of the metaclasses of688all the class's bases.689690## Why is it bad?691Such a class definition raises a `TypeError` at runtime.692693## Examples694```python695class M1(type): ...696class M2(type): ...697class A(metaclass=M1): ...698class B(metaclass=M2): ...699700# TypeError: metaclass conflict701class C(A, B): ...702```703704# cyclic-class-definition705706Default level: error | Stable (since 0.0.1-alpha.1)707708## What it does709Checks for class definitions in stub files that inherit710(directly or indirectly) from themselves.711712## Why is it bad?713Although forward references are natively supported in stub files,714inheritance cycles are still disallowed, as it is impossible to715resolve a consistent [method resolution order] for a class that716inherits from itself.717718## Examples719```python720# foo.pyi721class A(B): ...722class B(A): ...723```724725[method resolution order]: https://docs.python.org/3/glossary.html#term-method-resolution-order726727# cyclic-type-alias-definition728729Default level: error | Stable (since 0.0.1-alpha.29)730731## What it does732Checks for type alias definitions that (directly or mutually) refer to themselves.733734## Why is it bad?735Although it is permitted to define a recursive type alias, it is not meaningful736to have a type alias whose expansion can only result in itself, and is therefore not allowed.737738## Examples739```python740type Itself = Itself741742type A = B743type B = A744```745746# dataclass-field-order747748Default level: error | Stable (since 0.0.15)749750## What it does751Checks for dataclass definitions where required fields are defined after752fields with default values.753754## Why is this bad?755In dataclasses, all required fields (fields without default values) must be756defined before fields with default values. This is a Python requirement that757will raise a `TypeError` at runtime if violated.758759## Example760```python761from dataclasses import dataclass762763@dataclass764class Example:765 x: int = 1 # Field with default value766 y: str # Error: Required field after field with default767```768769# deprecated770771Default level: warn | Stable (since 0.0.1-alpha.16)772773## What it does774Checks for uses of deprecated items775776## Why is this bad?777Deprecated items should no longer be used.778779## Examples780```python781@warnings.deprecated("use new_func instead")782def old_func(): ...783784old_func() # emits [deprecated] diagnostic785```786787# division-by-zero788789Default level: ignore | Stable (since 0.0.1-alpha.1)790791## What it does792It detects division by zero.793794## Why is this bad?795Dividing by zero raises a `ZeroDivisionError` at runtime.796797## Rule status798This rule is currently disabled by default because of the number of799false positives it can produce.800801## Examples802```python8035 / 0804```805806# duplicate-base807808Default level: error | Stable (since 0.0.1-alpha.1)809810## What it does811Checks for class definitions with duplicate bases.812813## Why is this bad?814Class definitions with duplicate bases raise `TypeError` at runtime.815816## Examples817```python818class A: ...819820# TypeError: duplicate base class821class B(A, A): ...822```823824# duplicate-kw-only825826Default level: error | Stable (since 0.0.1-alpha.12)827828## What it does829Checks for dataclass definitions with more than one field830annotated with `KW_ONLY`.831832## Why is this bad?833`dataclasses.KW_ONLY` is a special marker used to834emulate the `*` syntax in normal signatures.835It can only be used once per dataclass.836837Attempting to annotate two different fields with838it will lead to a runtime error.839840## Examples841```python842from dataclasses import dataclass, KW_ONLY843844@dataclass845class A: # Crash at runtime846 b: int847 _1: KW_ONLY848 c: str849 _2: KW_ONLY850 d: bytes851```852853# empty-body854855Default level: error | Stable (since 0.0.14)856857## What it does858Detects functions with empty bodies that have a non-`None` return type annotation.859860The errors reported by this rule have the same motivation as the `invalid-return-type`861rule. The diagnostic exists as a separate error code to allow users to disable this862rule while prototyping code. While we strongly recommend enabling this rule if863possible, users migrating from other type checkers may also find it useful to864temporarily disable this rule on some or all of their codebase if they find it865results in a large number of diagnostics.866867## Why is this bad?868A function with an empty body (containing only `...`, `pass`, or a docstring) will869implicitly return `None` at runtime. Returning `None` when the return type is non-`None`870is unsound, and will lead to ty inferring incorrect types elsewhere.871872Functions with empty bodies are permitted in certain contexts where they serve as873declarations rather than implementations:874875- Functions in stub files (`.pyi`)876- Methods in Protocol classes877- Abstract methods decorated with `@abstractmethod`878- Overload declarations decorated with `@overload`879- Functions in `if TYPE_CHECKING` blocks880881## Examples882```python883def foo() -> int: ... # error: [empty-body]884885def bar() -> str:886 """A function that does nothing."""887 pass # error: [empty-body]888```889890# escape-character-in-forward-annotation891892Default level: error | Stable (since 0.0.1-alpha.1)893894## What it does895Checks for forward annotations that contain escape characters.896897## Why is this bad?898Static analysis tools like ty can't analyze type annotations that contain escape characters.899900## Example901902```python903def foo() -> "intt\b": ...904```905906# final-on-non-method907908Default level: error | Stable (since 0.0.20)909910## What it does911Checks for `@final` decorators applied to non-method functions.912913## Why is this bad?914The `@final` decorator is only meaningful on methods and classes.915Applying it to a module-level function or a nested function has no916effect and is likely a mistake.917918## Example919920```python921from typing import final922923# Error: @final is not allowed on non-method functions924@final925def my_function() -> int:926 return 0927```928929# final-without-value930931Default level: error | Stable (since 0.0.15)932933## What it does934Checks for `Final` symbols that are declared without a value and are never935assigned a value in their scope.936937## Why is this bad?938A `Final` symbol must be initialized with a value at the time of declaration939or in a subsequent assignment. At module or function scope, the assignment must940occur in the same scope. In a class body, the assignment may occur in `__init__`.941942## Examples943```python944from typing import Final945946# Error: `Final` symbol without a value947MY_CONSTANT: Final[int]948949# OK: `Final` symbol with a value950MY_CONSTANT: Final[int] = 1951```952953# ignore-comment-unknown-rule954955Default level: warn | Stable (since 0.0.1-alpha.1)956957## What it does958Checks for `ty: ignore[code]` or `type: ignore[ty:code]` comments where `code` isn't a known lint rule.959960## Why is this bad?961A `ty: ignore[code]` or a `type:ignore[ty:code] directive with a `code` that doesn't match962any known rule will not suppress any type errors, and is probably a mistake.963964## Examples965```py966a = 20 / 0 # ty: ignore[division-by-zer]967```968969Use instead:970971```py972a = 20 / 0 # ty: ignore[division-by-zero]973```974975# implicit-concatenated-string-type-annotation976977Default level: error | Stable (since 0.0.1-alpha.1)978979## What it does980Checks for implicit concatenated strings in type annotation positions.981982## Why is this bad?983Static analysis tools like ty can't analyze type annotations that use implicit concatenated strings.984985## Examples986```python987def test(): -> "Literal[" "5" "]":988 ...989```990991Use instead:992```python993def test(): -> "Literal[5]":994 ...995```996997# inconsistent-mro998999Default level: error | Stable (since 0.0.1-alpha.1)10001001## What it does1002Checks for classes with an inconsistent [method resolution order] (MRO).10031004## Why is this bad?1005Classes with an inconsistent MRO will raise a `TypeError` at runtime.10061007## Examples1008```python1009class A: ...1010class B(A): ...10111012# TypeError: Cannot create a consistent method resolution order1013class C(A, B): ...1014```10151016[method resolution order]: https://docs.python.org/3/glossary.html#term-method-resolution-order10171018# index-out-of-bounds10191020Default level: error | Stable (since 0.0.1-alpha.1)10211022## What it does1023Checks for attempts to use an out of bounds index to get an item from1024a container.10251026## Why is this bad?1027Using an out of bounds index will raise an `IndexError` at runtime.10281029## Examples1030```python1031t = (0, 1, 2)1032t[3] # IndexError: tuple index out of range1033```10341035# ineffective-final10361037Default level: warn | Stable (since 0.0.1-alpha.33)10381039## What it does1040Checks for calls to `final()` that type checkers cannot interpret.10411042## Why is this bad?1043The `final()` function is designed to be used as a decorator. When called directly1044as a function (e.g., `final(type(...))`), type checkers will not understand the1045application of `final` and will not prevent subclassing.10461047## Example10481049```python1050from typing import final10511052# Incorrect: type checkers will not prevent subclassing1053MyClass = final(type("MyClass", (), {}))10541055# Correct: use `final` as a decorator1056@final1057class MyClass: ...1058```10591060# instance-layout-conflict10611062Default level: error | Stable (since 0.0.1-alpha.12)10631064test rule::rule_default_output ... ## What it does1065Checks for classes definitions which will fail at runtime due to1066"instance memory layout conflicts".10671068This error is usually caused by attempting to combine multiple classes1069that define non-empty `__slots__` in a class's [Method Resolution Order]1070(MRO), or by attempting to combine multiple builtin classes in a class's1071MRO.10721073## Why is this bad?1074Inheriting from bases with conflicting instance memory layouts1075will lead to a `TypeError` at runtime.10761077An instance memory layout conflict occurs when CPython cannot determine1078the memory layout instances of a class should have, because the instance1079memory layout of one of its bases conflicts with the instance memory layout1080of one or more of its other bases.10811082For example, if a Python class defines non-empty `__slots__`, this will1083impact the memory layout of instances of that class. Multiple inheritance1084from more than one different class defining non-empty `__slots__` is not1085allowed:10861087```python1088class A:1089 __slots__ = ("a", "b")10901091class B:1092 __slots__ = ("a", "b") # Even if the values are the same10931094# TypeError: multiple bases have instance lay-out conflict1095class C(A, B): ...1096```10971098An instance layout conflict can also be caused by attempting to use1099multiple inheritance with two builtin classes, due to the way that these1100classes are implemented in a CPython C extension:11011102```python1103class A(int, float): ... # TypeError: multiple bases have instance lay-out conflict1104```11051106Note that pure-Python classes with no `__slots__`, or pure-Python classes1107with empty `__slots__`, are always compatible:11081109```python1110class A: ...1111class B:1112 __slots__ = ()1113class C:1114 __slots__ = ("a", "b")11151116# fine1117class D(A, B, C): ...1118```11191120## Known problems1121Classes that have "dynamic" definitions of `__slots__` (definitions do not consist1122of string literals, or tuples of string literals) are not currently considered disjoint1123bases by ty.11241125Additionally, this check is not exhaustive: many C extensions (including several in1126the standard library) define classes that use extended memory layouts and thus cannot1127coexist in a single MRO. Since it is currently not possible to represent this fact in1128stub files, having a full knowledge of these classes is also impossible. When it comes1129to classes that do not define `__slots__` at the Python level, therefore, ty, currently1130only hard-codes a number of cases where it knows that a class will produce instances with1131an atypical memory layout.11321133## Further reading1134- [CPython documentation: `__slots__`](https://docs.python.org/3/reference/datamodel.html#slots)1135- [CPython documentation: Method Resolution Order](https://docs.python.org/3/glossary.html#term-method-resolution-order)11361137[Method Resolution Order]: https://docs.python.org/3/glossary.html#term-method-resolution-order11381139# invalid-argument-type11401141Default level: error | Stable (since 0.0.1-alpha.1)11421143## What it does1144Detects call arguments whose type is not assignable to the corresponding typed parameter.11451146## Why is this bad?1147Passing an argument of a type the function (or callable object) does not accept violates1148the expectations of the function author and may cause unexpected runtime errors within the1149body of the function.11501151## Examples1152```python1153def func(x: int): ...1154func("foo") # error: [invalid-argument-type]1155```11561157# invalid-assignment11581159Default level: error | Stable (since 0.0.1-alpha.1)11601161## What it does1162Checks for assignments where the type of the value1163is not [assignable to] the type of the assignee.11641165## Why is this bad?1166Such assignments break the rules of the type system and1167weaken a type checker's ability to accurately reason about your code.11681169## Examples1170```python1171a: int = ''1172```11731174[assignable to]: https://typing.python.org/en/latest/spec/glossary.html#term-assignable11751176# invalid-attribute-access11771178Default level: error | Stable (since 0.0.1-alpha.1)11791180## What it does1181Checks for assignments to class variables from instances1182and assignments to instance variables from its class.11831184## Why is this bad?1185Incorrect assignments break the rules of the type system and1186weaken a type checker's ability to accurately reason about your code.11871188## Examples1189```python1190class C:1191 class_var: ClassVar[int] = 11192 instance_var: int11931194C.class_var = 3 # okay1195C().class_var = 3 # error: Cannot assign to class variable11961197C().instance_var = 3 # okay1198C.instance_var = 3 # error: Cannot assign to instance variable1199```12001201# invalid-attribute-override12021203Default level: error | Stable (since 0.0.33)12041205## What it does1206Detects attribute overrides that change whether an inherited attribute1207is a class variable or an instance variable.12081209This rule currently only covers class-variable and instance-variable1210category changes.12111212## Why is this bad?1213Pure class variables and instance variables have different access and1214assignment behavior. Overriding one with the other violates the1215[Liskov Substitution Principle] ("LSP"), because code that is valid for1216the superclass may no longer be valid for the subclass.12171218## Example1219```python1220from typing import ClassVar12211222class Base:1223 instance_attr: int1224 class_attr: ClassVar[int]12251226class Sub(Base):1227 instance_attr: ClassVar[int] # error: [invalid-attribute-override]1228 class_attr: int # error: [invalid-attribute-override]1229```12301231[Liskov Substitution Principle]: https://en.wikipedia.org/wiki/Liskov_substitution_principle12321233# invalid-await12341235Default level: error | Stable (since 0.0.1-alpha.19)12361237## What it does1238Checks for `await` being used with types that are not [Awaitable].12391240## Why is this bad?1241Such expressions will lead to `TypeError` being raised at runtime.12421243## Examples1244```python1245import asyncio12461247class InvalidAwait:1248 def __await__(self) -> int:1249 return 512501251async def main() -> None:1252 await InvalidAwait() # error: [invalid-await]1253 await 42 # error: [invalid-await]12541255asyncio.run(main())1256```12571258[Awaitable]: https://docs.python.org/3/library/collections.abc.html#collections.abc.Awaitable12591260# invalid-base12611262Default level: error | Stable (since 0.0.1-alpha.1)12631264## What it does1265Checks for class definitions that have bases which are not instances of `type`.12661267## Why is this bad?1268Class definitions with bases like this will lead to `TypeError` being raised at runtime.12691270## Examples1271```python1272class A(42): ... # error: [invalid-base]1273```12741275# invalid-context-manager12761277Default level: error | Stable (since 0.0.1-alpha.1)12781279## What it does1280Checks for expressions used in `with` statements1281that do not implement the context manager protocol.12821283## Why is this bad?1284Such a statement will raise `TypeError` at runtime.12851286## Examples1287```python1288# TypeError: 'int' object does not support the context manager protocol1289with 1:1290 print(2)1291```12921293# invalid-dataclass12941295Default level: error | Stable (since 0.0.12)12961297## What it does1298Checks for invalid applications of the `@dataclass` decorator.12991300## Why is this bad?1301Applying `@dataclass` to a class that inherits from `NamedTuple`, `TypedDict`,1302`Enum`, or `Protocol` is invalid:13031304- `NamedTuple` and `TypedDict` classes will raise an exception at runtime when1305 instantiating the class.1306- `Enum` classes with `@dataclass` are [explicitly not supported].1307- `Protocol` classes define interfaces and cannot be instantiated.13081309## Examples1310```python1311from dataclasses import dataclass1312from typing import NamedTuple13131314@dataclass # error: [invalid-dataclass]1315class Foo(NamedTuple):1316 x: int1317```13181319[explicitly not supported]: https://docs.python.org/3/howto/enum.html#dataclass-support13201321# invalid-dataclass-override13221323Default level: error | Stable (since 0.0.13)13241325## What it does1326Checks for dataclass definitions that have both `frozen=True` and a custom `__setattr__` or1327`__delattr__` method defined.13281329## Why is this bad?1330Frozen dataclasses synthesize `__setattr__` and `__delattr__` methods which raise a1331`FrozenInstanceError` to emulate immutability.13321333Overriding either of these methods raises a runtime error.13341335## Examples1336```python1337from dataclasses import dataclass13381339@dataclass(frozen=True)1340class A:1341 def __setattr__(self, name: str, value: object) -> None: ...1342```13431344# invalid-declaration13451346Default level: error | Stable (since 0.0.1-alpha.1)13471348ok1349test rule::rule_json_output ... ok1350## What it does1351Checks for declarations where the inferred type of an existing symbol1352is not [assignable to] its post-hoc declared type.13531354## Why is this bad?1355Such declarations break the rules of the type system and1356weaken a type checker's ability to accurately reason about your code.13571358## Examples1359```python1360a = 11361a: str1362```13631364[assignable to]: https://typing.python.org/en/latest/spec/glossary.html#term-assignable13651366# invalid-enum-member-annotation13671368Default level: warn | Stable (since 0.0.20)13691370## What it does1371Checks for enum members that have explicit type annotations.13721373## Why is this bad?1374The [typing spec] states that type checkers should infer a literal type1375for all enum members. An explicit type annotation on an enum member is1376misleading because the annotated type will be incorrect — the actual1377runtime type is the enum class itself, not the annotated type.13781379In CPython's `enum` module, annotated assignments with values are still1380treated as members at runtime, but the annotation will confuse readers of the code.13811382## Examples1383```python1384from enum import Enum13851386class Pet(Enum):1387 CAT = 1 # OK1388 DOG: int = 2 # Error: enum members should not be annotated1389```13901391Use instead:1392```python1393from enum import Enum13941395class Pet(Enum):1396 CAT = 11397 DOG = 21398```13991400## References1401- [Typing spec: Enum members](https://typing.python.org/en/latest/spec/enums.html#enum-members)14021403[typing spec]: https://typing.python.org/en/latest/spec/enums.html#enum-members14041405# invalid-exception-caught14061407Default level: error | Stable (since 0.0.1-alpha.1)14081409## What it does1410Checks for exception handlers that catch non-exception classes.14111412## Why is this bad?1413Catching classes that do not inherit from `BaseException` will raise a `TypeError` at runtime.14141415## Example1416```python1417try:1418 1 / 01419except 1:1420 ...1421```14221423Use instead:1424```python1425try:1426 1 / 01427except ZeroDivisionError:1428 ...1429```14301431## References1432- [Python documentation: except clause](https://docs.python.org/3/reference/compound_stmts.html#except-clause)1433- [Python documentation: Built-in Exceptions](https://docs.python.org/3/library/exceptions.html#built-in-exceptions)14341435## Ruff rule1436 This rule corresponds to Ruff's [`except-with-non-exception-classes` (`B030`)](https://docs.astral.sh/ruff/rules/except-with-non-exception-classes)14371438# invalid-explicit-override14391440Default level: error | Stable (since 0.0.1-alpha.28)14411442## What it does1443Checks for methods that are decorated with `@override` but do not override any method in a superclass.14441445## Why is this bad?1446Decorating a method with `@override` declares to the type checker that the intention is that it should1447override a method from a superclass.14481449## Example14501451```python1452from typing import override14531454class A:1455 @override1456 def foo(self): ... # Error raised here14571458class B(A):1459 @override1460 def ffooo(self): ... # Error raised here14611462class C:1463 @override1464 def __repr__(self): ... # fine: overrides `object.__repr__`14651466class D(A):1467 @override1468 def foo(self): ... # fine: overrides `A.foo`1469```14701471# invalid-frozen-dataclass-subclass14721473Default level: error | Stable (since 0.0.1-alpha.35)14741475## What it does1476Checks for dataclasses with invalid frozen inheritance:1477- A frozen dataclass cannot inherit from a non-frozen dataclass.1478- A non-frozen dataclass cannot inherit from a frozen dataclass.14791480## Why is this bad?1481Python raises a `TypeError` at runtime when either of these inheritance1482patterns occurs.14831484## Example14851486```python1487from dataclasses import dataclass14881489@dataclass1490class Base:1491 x: int14921493@dataclass(frozen=True)1494class Child(Base): # Error raised here1495 y: int14961497@dataclass(frozen=True)1498class FrozenBase:1499 x: int15001501@dataclass1502class NonFrozenChild(FrozenBase): # Error raised here1503 y: int1504```15051506# invalid-generic-class15071508Default level: error | Stable (since 0.0.1-alpha.1)15091510## What it does1511Checks for the creation of invalid generic classes15121513## Why is this bad?1514There are several requirements that you must follow when defining a generic class.1515Many of these result in `TypeError` being raised at runtime if they are violated.15161517## Examples1518```python1519from typing_extensions import Generic, TypeVar15201521T = TypeVar("T")1522U = TypeVar("U", default=int)15231524# error: class uses both PEP-695 syntax and legacy syntax1525class C[U](Generic[T]): ...15261527# error: type parameter with default comes before type parameter without default1528class D(Generic[U, T]): ...1529```15301531## References1532- [Typing spec: Generics](https://typing.python.org/en/latest/spec/generics.html#introduction)15331534# invalid-generic-enum15351536Default level: error | Stable (since 0.0.12)15371538## What it does1539Checks for enum classes that are also generic.15401541## Why is this bad?1542Enum classes cannot be generic. Python does not support generic enums:1543attempting to create one will either result in an immediate `TypeError`1544at runtime, or will create a class that cannot be specialized in the way1545that a normal generic class can.15461547## Examples1548```python1549from enum import Enum1550from typing import Generic, TypeVar15511552T = TypeVar("T")15531554# error: enum class cannot be generic (class creation fails with `TypeError`)1555class E[T](Enum):1556 A = 115571558# error: enum class cannot be generic (class creation fails with `TypeError`)1559class F(Enum, Generic[T]):1560 A = 115611562# error: enum class cannot be generic -- the class creation does not immediately fail...1563class G(Generic[T], Enum):1564 A = 115651566# ...but this raises `KeyError`:1567x: G[int]1568```15691570## References1571- [Python documentation: Enum](https://docs.python.org/3/library/enum.html)15721573# invalid-ignore-comment15741575Default level: warn | Stable (since 0.0.1-alpha.1)15761577## What it does1578Checks for `type: ignore` and `ty: ignore` comments that are syntactically incorrect.15791580## Why is this bad?1581A syntactically incorrect ignore comment is probably a mistake and is useless.15821583## Examples1584```py1585a = 20 / 0 # type: ignoree1586```15871588Use instead:15891590```py1591a = 20 / 0 # type: ignore1592```15931594# invalid-key15951596Default level: error | Stable (since 0.0.1-alpha.17)15971598## What it does1599Checks for subscript accesses with invalid keys and `TypedDict` construction with an1600unknown key.16011602## Why is this bad?1603Subscripting with an invalid key will raise a `KeyError` at runtime.16041605Creating a `TypedDict` with an unknown key is likely a mistake; if the `TypedDict` is1606`closed=true` it also violates the expectations of the type.16071608## Examples1609```python1610from typing import TypedDict16111612class Person(TypedDict):1613 name: str1614 age: int16151616alice = Person(name="Alice", age=30)1617alice["height"] # KeyError: 'height'16181619bob: Person = { "nickname": "Bob", "age": 30 } # typo!16201621carol = Person(name="Carol", aeg=25) # typo!1622```16231624# invalid-legacy-positional-parameter16251626Default level: warn | Stable (since 0.0.15)16271628## What it does16291630Checks for parameters that appear to be attempting to use the legacy convention1631to specify that a parameter is positional-only, but do so incorrectly.16321633The "legacy convention" for specifying positional-only parameters was1634specified in [PEP 484]. It states that parameters with names starting with1635`__` should be considered positional-only by type checkers. [PEP 570], introduced1636in Python 3.8, added dedicated syntax for specifying positional-only parameters,1637rendering the legacy convention obsolete. However, some codebases may still1638use the legacy convention for compatibility with older Python versions.16391640## Why is this bad?16411642In most cases, a type checker will not consider a parameter to be positional-only1643if it comes after a positional-or-keyword parameter, even if its name starts with1644`__`. This may be unexpected to the author of the code.16451646## Example16471648```python1649def f(x, __y): # Error: `__y` is not considered positional-only1650 pass1651```16521653Use instead:16541655```python1656def f(__x, __y): # If you need compatibility with Python <=3.71657 pass1658```16591660or:16611662```python1663def f(x, y, /): # Python 3.8+ syntax1664 pass1665```16661667## References16681669- [Typing spec: positional-only parameters (legacy syntax)](https://typing.python.org/en/latest/spec/historical.html#pos-only-double-underscore)1670- [Python glossary: parameters](https://docs.python.org/3/glossary.html#term-parameter)16711672[PEP 484]: https://peps.python.org/pep-0484/#positional-only-arguments1673[PEP 570]: https://peps.python.org/pep-0570/16741675# invalid-legacy-type-variable16761677Default level: error | Stable (since 0.0.1-alpha.1)16781679## What it does1680Checks for the creation of invalid legacy `TypeVar`s16811682## Why is this bad?1683There are several requirements that you must follow when creating a legacy `TypeVar`.16841685## Examples1686```python1687from typing import TypeVar16881689T = TypeVar("T") # okay1690Q = TypeVar("S") # error: TypeVar name must match the variable it's assigned to1691T = TypeVar("T") # error: TypeVars should not be redefined16921693# error: TypeVar must be immediately assigned to a variable1694def f(t: TypeVar("U")): ...1695```16961697## References1698- [Typing spec: Generics](https://typing.python.org/en/latest/spec/generics.html#introduction)16991700# invalid-match-pattern17011702Default level: error | Stable (since 0.0.18)17031704## What it does1705Checks for invalid match patterns.17061707## Why is this bad?1708Matching on invalid patterns will lead to a runtime error.17091710## Examples1711```python1712NotAClass = 4217131714match x:1715 case NotAClass(): # TypeError at runtime: must be a class1716 ...1717```17181719# invalid-metaclass17201721Default level: error | Stable (since 0.0.1-alpha.1)17221723## What it does1724Checks for arguments to `metaclass=` that are invalid.17251726## Why is this bad?1727Python allows arbitrary expressions to be used as the argument to `metaclass=`.1728These expressions, however, need to be callable and accept the same arguments1729as `type.__new__`.17301731## Example17321733```python1734def f(): ...17351736# TypeError: f() takes 0 positional arguments but 3 were given1737class B(metaclass=f): ...1738```17391740## References1741- [Python documentation: Metaclasses](https://docs.python.org/3/reference/datamodel.html#metaclasses)17421743# invalid-method-override17441745Default level: error | Stable (since 0.0.1-alpha.20)17461747## What it does1748Detects method overrides that violate the [Liskov Substitution Principle] ("LSP").17491750The LSP states that an instance of a subtype should be substitutable for an instance of its supertype.1751Applied to Python, this means:17521. All argument combinations a superclass method accepts1753 must also be accepted by an overriding subclass method.17542. The return type of an overriding subclass method must be a subtype1755 of the return type of the superclass method.17561757## Why is this bad?1758Violating the Liskov Substitution Principle will lead to many of ty's assumptions and1759inferences being incorrect, which will mean that it will fail to catch many possible1760type errors in your code.17611762## Example1763```python1764class Super:1765 def method(self, x) -> int:1766 return 4217671768class Sub(Super):1769 # Liskov violation: `str` is not a subtype of `int`,1770 # but the supertype method promises to return an `int`.1771 def method(self, x) -> str: # error: [invalid-override]1772 return "foo"17731774def accepts_super(s: Super) -> int:1775 return s.method(x=42)17761777accepts_super(Sub()) # The result of this call is a string, but ty will infer1778 # it to be an `int` due to the violation of the Liskov Substitution Principle.17791780class Sub2(Super):1781 # Liskov violation: the superclass method can be called with a `x=`1782 # keyword argument, but the subclass method does not accept it.1783 def method(self, y) -> int: # error: [invalid-override]1784 return 4217851786accepts_super(Sub2()) # TypeError at runtime: method() got an unexpected keyword argument 'x'1787 # ty cannot catch this error due to the violation of the Liskov Substitution Principle.1788```17891790## Common issues17911792### Why does ty complain about my `__eq__` method?17931794`__eq__` and `__ne__` methods in Python are generally expected to accept arbitrary1795objects as their second argument, for example:17961797```python1798class A:1799 x: int18001801 def __eq__(self, other: object) -> bool:1802 # gracefully handle an object of an unexpected type1803 # without raising an exception1804 if not isinstance(other, A):1805 return False1806 return self.x == other.x1807```18081809If `A.__eq__` here were annotated as only accepting `A` instances for its second argument,1810it would imply that you wouldn't be able to use `==` between instances of `A` and1811instances of unrelated classes without an exception possibly being raised. While some1812classes in Python do indeed behave this way, the strongly held convention is that it should1813be avoided wherever possible. As part of this check, therefore, ty enforces that `__eq__`1814and `__ne__` methods accept `object` as their second argument.18151816### Why does ty disagree with Ruff about how to write my method?18171818Ruff has several rules that will encourage you to rename a parameter, or change its type1819signature, if it thinks you're falling into a certain anti-pattern. For example, Ruff's1820[ARG002](https://docs.astral.sh/ruff/rules/unused-method-argument/) rule recommends that an1821unused parameter should either be removed or renamed to start with `_`. Applying either of1822these suggestions can cause ty to start reporting an `invalid-method-override` error if1823the function in question is a method on a subclass that overrides a method on a superclass,1824and the change would cause the subclass method to no longer accept all argument combinations1825that the superclass method accepts.18261827This can usually be resolved by adding [`@typing.override`][override] to your method1828definition. Ruff knows that a method decorated with `@typing.override` is intended to1829override a method by the same name on a superclass, and avoids reporting rules like ARG0021830for such methods; it knows that the changes recommended by ARG002 would violate the Liskov1831Substitution Principle.18321833Correct use of `@override` is enforced by ty's `invalid-explicit-override` rule.18341835[Liskov Substitution Principle]: https://en.wikipedia.org/wiki/Liskov_substitution_principle1836[override]: https://docs.python.org/3/library/typing.html#typing.override18371838# invalid-named-tuple18391840Default level: error | Stable (since 0.0.1-alpha.19)18411842## What it does1843Checks for invalidly defined `NamedTuple` classes.18441845## Why is this bad?1846An invalidly defined `NamedTuple` class may lead to the type checker1847drawing incorrect conclusions. It may also lead to `TypeError`s or1848`AttributeError`s at runtime.18491850## Examples1851A class definition cannot combine `NamedTuple` with other base classes1852in multiple inheritance; doing so raises a `TypeError` at runtime. The sole1853exception to this rule is `Generic[]`, which can be used alongside `NamedTuple`1854in a class's bases list.18551856```pycon1857>>> from typing import NamedTuple1858>>> class Foo(NamedTuple, object): ...1859TypeError: can only inherit from a NamedTuple type and Generic1860```18611862Further, `NamedTuple` field names cannot start with an underscore:18631864```pycon1865>>> from typing import NamedTuple1866>>> class Foo(NamedTuple):1867... _bar: int1868ValueError: Field names cannot start with an underscore: '_bar'1869```18701871`NamedTuple` classes also have certain synthesized attributes (like `_asdict`, `_make`,1872`_replace`, etc.) that cannot be overwritten. Attempting to assign to these attributes1873without a type annotation will raise an `AttributeError` at runtime.18741875```pycon1876>>> from typing import NamedTuple1877>>> class Foo(NamedTuple):1878... x: int1879... _asdict = 421880AttributeError: Cannot overwrite NamedTuple attribute _asdict1881```18821883# invalid-named-tuple-override18841885Default level: warn | Stable (since 0.0.31)18861887## What it does1888Checks for subclass members that override inherited `NamedTuple` fields.18891890## Why is this bad?1891Reusing an inherited `NamedTuple` field name in a subclass creates a1892class where tuple indexing and `repr()` still reflect the original1893field, while attribute access follows the subclass member.18941895## Default level1896This rule is a warning by default because these overrides do not make1897the class invalid at runtime.18981899## Examples1900```python1901from typing import NamedTuple19021903class User(NamedTuple):1904 name: str19051906class Admin(User):1907 name = "shadowed" # error: [invalid-named-tuple-override]19081909admin = Admin("Alice")1910admin.name # "shadowed"1911admin[0] # "Alice"1912```19131914# invalid-newtype19151916Default level: error | Stable (since 0.0.1-alpha.27)19171918## What it does1919Checks for the creation of invalid `NewType`s19201921## Why is this bad?1922There are several requirements that you must follow when creating a `NewType`.19231924## Examples1925```python1926from typing import NewType19271928def get_name() -> str: ...19291930Foo = NewType("Foo", int) # okay1931Bar = NewType(get_name(), int) # error: The first argument to `NewType` must be a string literal1932Baz = NewType("Baz", int | str) # error: invalid base for `typing.NewType`1933```19341935# invalid-overload19361937Default level: error | Stable (since 0.0.1-alpha.1)19381939## What it does1940Checks for various invalid `@overload` usages.19411942## Why is this bad?1943The `@overload` decorator is used to define functions and methods that accepts different1944combinations of arguments and return different types based on the arguments passed. This is1945mainly beneficial for type checkers. But, if the `@overload` usage is invalid, the type1946checker may not be able to provide correct type information.19471948## Example19491950Defining only one overload:19511952```py1953from typing import overload19541955@overload1956def foo(x: int) -> int: ...1957def foo(x: int | None) -> int | None:1958 return x1959```19601961Or, not providing an implementation for the overloaded definition:19621963```py1964from typing import overload19651966@overload1967def foo() -> None: ...1968@overload1969def foo(x: int) -> int: ...1970```19711972## References1973- [Python documentation: `@overload`](https://docs.python.org/3/library/typing.html#typing.overload)19741975# invalid-parameter-default19761977Default level: error | Stable (since 0.0.1-alpha.1)19781979## What it does1980Checks for default values that can't be1981assigned to the parameter's annotated type.19821983## Why is this bad?1984This breaks the rules of the type system and1985weakens a type checker's ability to accurately reason about your code.19861987## Examples1988```python1989def f(a: int = ''): ...1990```19911992# invalid-paramspec19931994Default level: error | Stable (since 0.0.1-alpha.1)19951996## What it does1997Checks for the creation of invalid `ParamSpec`s19981999## Why is this bad?2000There are several requirements that you must follow when creating a `ParamSpec`.20012002## Examples2003```python2004from typing import ParamSpec20052006P1 = ParamSpec("P1") # okay2007P2 = ParamSpec("S2") # error: ParamSpec name must match the variable it's assigned to2008```20092010## References2011- [Typing spec: ParamSpec](https://typing.python.org/en/latest/spec/generics.html#paramspec)20122013# invalid-protocol20142015Default level: error | Stable (since 0.0.1-alpha.1)20162017## What it does2018Checks for protocol classes that will raise `TypeError` at runtime.20192020## Why is this bad?2021An invalidly defined protocol class may lead to the type checker inferring2022unexpected things. It may also lead to `TypeError`s at runtime.20232024## Examples2025A `Protocol` class cannot inherit from a non-`Protocol` class;2026this raises a `TypeError` at runtime:20272028```pycon2029>>> from typing import Protocol2030>>> class Foo(int, Protocol): ...2031...2032Traceback (most recent call last):2033 File "<python-input-1>", line 1, in <module>2034 class Foo(int, Protocol): ...2035TypeError: Protocols can only inherit from other protocols, got <class 'int'>2036```20372038# invalid-raise20392040Default level: error | Stable (since 0.0.1-alpha.1)20412042Checks for `raise` statements that raise non-exceptions or use invalid2043causes for their raised exceptions.20442045## Why is this bad?2046Only subclasses or instances of `BaseException` can be raised.2047For an exception's cause, the same rules apply, except that `None` is also2048permitted. Violating these rules results in a `TypeError` at runtime.20492050## Examples2051```python2052def f():2053 try:2054 something()2055 except NameError:2056 raise "oops!" from f20572058def g():2059 raise NotImplemented from 422060```20612062Use instead:2063```python2064def f():2065 try:2066 something()2067 except NameError as e:2068 raise RuntimeError("oops!") from e20692070def g():2071 raise NotImplementedError from None2072```20732074## References2075- [Python documentation: The `raise` statement](https://docs.python.org/3/reference/simple_stmts.html#raise)2076- [Python documentation: Built-in Exceptions](https://docs.python.org/3/library/exceptions.html#built-in-exceptions)20772078# invalid-return-type20792080Default level: error | Stable (since 0.0.1-alpha.1)20812082## What it does2083Detects returned values that can't be assigned to the function's annotated return type.20842085Note that the special case of a function with a non-`None` return type and an empty body2086is handled by the separate `empty-body` error code.20872088## Why is this bad?2089Returning an object of a type incompatible with the annotated return type2090is unsound, and will lead to ty inferring incorrect types elsewhere.20912092## Examples2093```python2094def func() -> int:2095 return "a" # error: [invalid-return-type]2096```20972098# invalid-super-argument20992100Default level: error | Stable (since 0.0.1-alpha.1)21012102## What it does2103Detects `super()` calls where:2104- the first argument is not a valid class literal, or2105- the second argument is not an instance or subclass of the first argument.21062107## Why is this bad?2108`super(type, obj)` expects:2109- the first argument to be a class,2110- and the second argument to satisfy one of the following:2111 - `isinstance(obj, type)` is `True`2112 - `issubclass(obj, type)` is `True`21132114Violating this relationship will raise a `TypeError` at runtime.21152116## Examples2117```python2118class A:2119 ...2120class B(A):2121 ...21222123super(A, B()) # it's okay! `A` satisfies `isinstance(B(), A)`21242125super(A(), B()) # error: `A()` is not a class21262127super(B, A()) # error: `A()` does not satisfy `isinstance(A(), B)`2128super(B, A) # error: `A` does not satisfy `issubclass(A, B)`2129```21302131## References2132- [Python documentation: super()](https://docs.python.org/3/library/functions.html#super)21332134# invalid-syntax-in-forward-annotation21352136Default level: error | Stable (since 0.0.1-alpha.1)21372138## What it does2139Checks for string-literal annotations where the string cannot be2140parsed as a Python expression.21412142## Why is this bad?2143Type annotations are expected to be Python expressions that2144describe the expected type of a variable, parameter, attribute or2145`return` statement.21462147Type annotations are permitted to be string-literal expressions, in2148order to enable forward references to names not yet defined.2149However, it must be possible to parse the contents of that string2150literal as a normal Python expression.21512152## Example21532154```python2155def foo() -> "intstance of C":2156 return 4221572158class C: ...2159```21602161Use instead:21622163```python2164def foo() -> "C":2165 return 4221662167class C: ...2168```21692170## References2171- [Typing spec: The meaning of annotations](https://typing.python.org/en/latest/spec/annotations.html#the-meaning-of-annotations)2172- [Typing spec: String annotations](https://typing.python.org/en/latest/spec/annotations.html#string-annotations)21732174# invalid-total-ordering21752176Default level: error | Stable (since 0.0.10)21772178## What it does2179Checks for classes decorated with `@functools.total_ordering` that don't2180define any ordering method (`__lt__`, `__le__`, `__gt__`, or `__ge__`).21812182## Why is this bad?2183The `@total_ordering` decorator requires the class to define at least one2184ordering method. If none is defined, Python raises a `ValueError` at runtime.21852186## Example21872188```python2189from functools import total_ordering21902191@total_ordering2192class MyClass: # Error: no ordering method defined2193 def __eq__(self, other: object) -> bool:2194 return True2195```21962197Use instead:21982199```python2200from functools import total_ordering22012202@total_ordering2203class MyClass:2204 def __eq__(self, other: object) -> bool:2205 return True22062207 def __lt__(self, other: "MyClass") -> bool:2208 return True2209```22102211# invalid-type-alias-type22122213Default level: error | Stable (since 0.0.1-alpha.6)22142215## What it does2216Checks for the creation of invalid `TypeAliasType`s22172218## Why is this bad?2219There are several requirements that you must follow when creating a `TypeAliasType`.22202221## Examples2222```python2223from typing import TypeAliasType22242225IntOrStr = TypeAliasType("IntOrStr", int | str) # okay2226NewAlias = TypeAliasType(get_name(), int) # error: TypeAliasType name must be a string literal2227```22282229# invalid-type-arguments22302231Default level: error | Stable (since 0.0.1-alpha.29)22322233## What it does2234Checks for invalid type arguments in explicit type specialization.22352236## Why is this bad?2237Providing the wrong number of type arguments or type arguments that don't2238satisfy the type variable's bounds or constraints will lead to incorrect2239type inference and may indicate a misunderstanding of the generic type's2240interface.22412242## Examples22432244Using legacy type variables:2245```python2246from typing import Generic, TypeVar22472248T1 = TypeVar('T1', int, str)2249T2 = TypeVar('T2', bound=int)22502251class Foo1(Generic[T1]): ...2252class Foo2(Generic[T2]): ...22532254Foo1[bytes] # error: bytes does not satisfy T1's constraints2255Foo2[str] # error: str does not satisfy T2's bound2256```22572258Using PEP 695 type variables:2259```python2260class Foo[T]: ...2261class Bar[T, U]: ...22622263Foo[int, str] # error: too many arguments2264Bar[int] # error: too few arguments2265```22662267# invalid-type-checking-constant22682269Default level: error | Stable (since 0.0.1-alpha.1)22702271## What it does2272Checks for a value other than `False` assigned to the `TYPE_CHECKING` variable, or an2273annotation not assignable from `bool`.22742275## Why is this bad?2276The name `TYPE_CHECKING` is reserved for a flag that can be used to provide conditional2277code seen only by the type checker, and not at runtime. Normally this flag is imported from2278`typing` or `typing_extensions`, but it can also be defined locally. If defined locally, it2279must be assigned the value `False` at runtime; the type checker will consider its value to2280be `True`. If annotated, it must be annotated as a type that can accept `bool` values.22812282## Examples2283```python2284TYPE_CHECKING: str2285TYPE_CHECKING = ''2286```22872288# invalid-type-form22892290Default level: error | Stable (since 0.0.1-alpha.1)22912292## What it does2293Checks for expressions that are used as [type expressions]2294but cannot validly be interpreted as such.22952296## Why is this bad?2297Such expressions cannot be understood by ty.2298In some cases, they might raise errors at runtime.22992300## Examples2301```python2302from typing import Annotated23032304a: type[1] # `1` is not a type2305b: Annotated[int] # `Annotated` expects at least two arguments2306```2307[type expressions]: https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions23082309# invalid-type-guard-call23102311Default level: error | Stable (since 0.0.1-alpha.11)23122313## What it does2314Checks for type guard function calls without a valid target.23152316## Why is this bad?2317The first non-keyword non-variadic argument to a type guard function2318is its target and must map to a symbol.23192320Starred (`is_str(*a)`), literal (`is_str(42)`) and other non-symbol-like2321expressions are invalid as narrowing targets.23222323## Examples2324```python2325from typing import TypeIs23262327def f(v: object) -> TypeIs[int]: ...23282329f() # Error2330f(*a) # Error2331f(10) # Error2332```23332334# invalid-type-guard-definition23352336Default level: error | Stable (since 0.0.1-alpha.11)23372338## What it does2339Checks for type guard functions without2340a first non-self-like non-keyword-only non-variadic parameter.23412342## Why is this bad?2343Type narrowing functions must accept at least one positional argument2344(non-static methods must accept another in addition to `self`/`cls`).23452346Extra parameters/arguments are allowed but do not affect narrowing.23472348## Examples2349```python2350from typing import TypeIs23512352def f() -> TypeIs[int]: ... # Error, no parameter2353def f(*, v: object) -> TypeIs[int]: ... # Error, no positional arguments allowed2354def f(*args: object) -> TypeIs[int]: ... # Error, expect variadic arguments2355class C:2356 def f(self) -> TypeIs[int]: ... # Error, only positional argument expected is `self`2357```23582359# invalid-type-variable-bound23602361Default level: error | Stable (since 0.0.15)23622363## What it does2364Checks for [type variables] whose bounds reference type variables.23652366## Why is this bad?2367The bound of a type variable must be a concrete type.23682369## Examples2370```python2371T = TypeVar('T', bound=list['T']) # error: [invalid-type-variable-bound]2372U = TypeVar('U')2373T = TypeVar('T', bound=U) # error: [invalid-type-variable-bound]23742375def f[T: list[T]](): ... # error: [invalid-type-variable-bound]2376def g[U, T: U](): ... # error: [invalid-type-variable-bound]2377```23782379[type variable]: https://docs.python.org/3/library/typing.html#typing.TypeVar23802381# invalid-type-variable-constraints23822383Default level: error | Stable (since 0.0.1-alpha.1)23842385## What it does23862387Checks for constrained [type variables] with only one constraint,2388or that those constraints reference type variables.23892390## Why is this bad?23912392A constrained type variable must have at least two constraints.23932394## Examples23952396```python2397from typing import TypeVar23982399T = TypeVar('T', str) # invalid constrained TypeVar24002401I = TypeVar('I', bound=int)2402U = TypeVar('U', list[I], int) # invalid constrained TypeVar2403```24042405Use instead:24062407```python2408T = TypeVar('T', str, int) # valid constrained TypeVar24092410# or24112412T = TypeVar('T', bound=str) # valid bound TypeVar24132414U = TypeVar('U', list[int], int) # valid constrained Type2415```24162417[type variables]: https://docs.python.org/3/library/typing.html#typing.TypeVar24182419# invalid-type-variable-default24202421Default level: error | Stable (since 0.0.16)24222423## What it does2424Checks for [type variables] whose default type is not compatible with2425the type variable's bound or constraints.24262427## Why is this bad?2428If a type variable has a bound, the default must be assignable to that2429bound (see: [bound rules]). If a type variable has constraints, the default2430must be one of the constraints (see: [constraint rules]).24312432## Examples2433```python2434T = TypeVar("T", bound=str, default=int) # error: [invalid-type-variable-default]2435U = TypeVar("U", int, str, default=bytes) # error: [invalid-type-variable-default]2436```24372438[type variables]: https://docs.python.org/3/library/typing.html#typing.TypeVar2439[bound rules]: https://typing.python.org/en/latest/spec/generics.html#bound-rules2440[constraint rules]: https://typing.python.org/en/latest/spec/generics.html#constraint-rules24412442# invalid-typed-dict-field24432444Default level: error | Stable (since 0.0.28)24452446## What it does2447Detects invalid `TypedDict` field declarations.24482449## Why is this bad?2450`TypedDict` subclasses cannot redefine inherited fields incompatibly. Doing so breaks the2451subtype guarantees that `TypedDict` inheritance is meant to preserve.24522453## Example2454```python2455from typing import TypedDict24562457class Base(TypedDict):2458 x: int24592460class Child(Base):2461 x: str # error: [invalid-typed-dict-field]2462```24632464# invalid-typed-dict-header24652466Default level: error | Stable (since 0.0.14)24672468## What it does2469Detects errors in `TypedDict` class headers, such as unexpected arguments2470or invalid base classes.24712472## Why is this bad?2473The typing spec states that `TypedDict`s are not permitted to have2474custom metaclasses. Using `**` unpacking in a `TypedDict` header2475is also prohibited by ty, as it means that ty cannot statically determine2476whether keys in the `TypedDict` are intended to be required or optional.24772478## Example2479```python2480from typing import TypedDict24812482class Foo(TypedDict, metaclass=whatever): # error: [invalid-typed-dict-header]2483 ...24842485def f(x: dict):2486 class Bar(TypedDict, **x): # error: [invalid-typed-dict-header]2487 ...2488```24892490# invalid-typed-dict-statement24912492Default level: error | Stable (since 0.0.9)24932494## What it does2495Detects statements other than annotated declarations in `TypedDict` class bodies.24962497## Why is this bad?2498`TypedDict` class bodies aren't allowed to contain any other types of statements. For2499example, method definitions and field values aren't allowed. None of these will be2500available on "instances of the `TypedDict`" at runtime (as `dict` is the runtime class of2501all "`TypedDict` instances").25022503## Example2504```python2505from typing import TypedDict25062507class Foo(TypedDict):2508 def bar(self): # error: [invalid-typed-dict-statement]2509 pass2510```25112512# invalid-yield25132514Default level: error | Stable (since 0.0.25)25152516## What it does2517Detects `yield` and `yield from` expressions where the "yield" or "send" type2518is incompatible with the generator function's annotated return type.25192520## Why is this bad?2521Yielding a value of a type that doesn't match the generator's declared yield type,2522or using `yield from` with a sub-iterator whose yield or send type is incompatible,2523is a type error that may cause downstream consumers of the generator to receive2524values of an unexpected type.25252526## Examples2527```python2528from typing import Iterator25292530def gen() -> Iterator[int]:2531 yield "not an int" # error: [invalid-yield]2532```25332534# isinstance-against-protocol25352536Default level: error | Stable (since 0.0.14)25372538## What it does2539Reports invalid runtime checks against `Protocol` classes.2540This includes explicit calls `isinstance()`/`issubclass()` against2541non-runtime-checkable protocols, `issubclass()` calls against protocols2542that have non-method members, and implicit `isinstance()` checks against2543non-runtime-checkable protocols via pattern matching.25442545## Why is this bad?2546These calls (implicit or explicit) raise `TypeError` at runtime.25472548## Examples2549```python2550from typing_extensions import Protocol, runtime_checkable25512552class HasX(Protocol):2553 x: int25542555@runtime_checkable2556class HasY(Protocol):2557 y: int25582559def f(arg: object, arg2: type):2560 isinstance(arg, HasX) # error: [isinstance-against-protocol] (not runtime-checkable)2561 issubclass(arg2, HasX) # error: [isinstance-against-protocol] (not runtime-checkable)25622563def g(arg: object):2564 match arg:2565 case HasX(): # error: [isinstance-against-protocol] (not runtime-checkable)2566 pass25672568def h(arg2: type):2569 isinstance(arg2, HasY) # fine (runtime-checkable)25702571 # `HasY` is runtime-checkable, but has non-method members,2572 # so it still can't be used in `issubclass` checks)2573 issubclass(arg2, HasY) # error: [isinstance-against-protocol]2574```25752576## References2577- [Typing documentation: `@runtime_checkable`](https://docs.python.org/3/library/typing.html#typing.runtime_checkable)25782579# isinstance-against-typed-dict25802581Default level: error | Stable (since 0.0.15)25822583## What it does2584Reports runtime checks against `TypedDict` classes.2585This includes explicit calls to `isinstance()`/`issubclass()` and implicit2586checks performed by `match` class patterns.25872588## Why is this bad?2589Using a `TypedDict` class in these contexts raises `TypeError` at runtime.25902591## Examples2592```python2593from typing_extensions import TypedDict25942595class Movie(TypedDict):2596 name: str2597 director: str25982599def f(arg: object, arg2: type):2600 isinstance(arg, Movie) # error: [isinstance-against-typed-dict]2601 issubclass(arg2, Movie) # error: [isinstance-against-typed-dict]26022603def g(arg: object):2604 match arg:2605 case Movie(): # error: [isinstance-against-typed-dict]2606 pass2607```26082609## References2610- [Typing specification: `TypedDict`](https://typing.python.org/en/latest/spec/typeddict.html)26112612# mismatched-type-name26132614Default level: warn | Stable (since 0.0.30)26152616## What it does2617Checks for functional typing definitions whose declared name does not match2618the variable they are assigned to.26192620## Why is this bad?2621Constructors like `TypeVar`, `ParamSpec`, `NewType`, `NamedTuple`,2622`TypedDict`, and `TypeAliasType` all take a name argument that is2623normally expected to match the assigned variable. A mismatch is usually a2624typo and makes later diagnostics harder to understand.26252626## Default level2627This rule is a warning by default because ty can usually recover and2628continue understanding the resulting type.26292630## Examples2631```python2632from typing import NewType, TypeVar2633from typing_extensions import TypedDict26342635T = TypeVar("U") # error: [mismatched-type-name]2636UserId = NewType("Id", int) # error: [mismatched-type-name]2637Movie = TypedDict("Film", {"title": str}) # error: [mismatched-type-name]2638```26392640# missing-argument26412642Default level: error | Stable (since 0.0.1-alpha.1)26432644## What it does2645Checks for missing required arguments in a call.26462647## Why is this bad?2648Failing to provide a required argument will raise a `TypeError` at runtime.26492650## Examples2651```python2652def func(x: int): ...2653func() # TypeError: func() missing 1 required positional argument: 'x'2654```26552656# missing-typed-dict-key26572658Default level: error | Stable (since 0.0.1-alpha.20)26592660## What it does2661Detects missing required keys in `TypedDict` constructor calls.26622663## Why is this bad?2664`TypedDict` requires all non-optional keys to be provided during construction.2665Missing items can lead to a `KeyError` at runtime.26662667## Example2668```python2669from typing import TypedDict26702671class Person(TypedDict):2672 name: str2673 age: int26742675alice: Person = {"name": "Alice"} # missing required key 'age'26762677alice["age"] # KeyError2678```26792680# no-matching-overload26812682Default level: error | Stable (since 0.0.1-alpha.1)26832684## What it does2685Checks for calls to an overloaded function that do not match any of the overloads.26862687## Why is this bad?2688Failing to provide the correct arguments to one of the overloads will raise a `TypeError`2689at runtime.26902691## Examples2692```python2693@overload2694def func(x: int): ...2695@overload2696def func(x: bool): ...2697func("string") # error: [no-matching-overload]2698```26992700# non-callable-init-subclass27012702Default level: error | Stable (since 0.0.30)27032704## What it does2705Checks for class definitions that will fail due to non-callable `__init_subclass__`2706methods.27072708## Why is this bad?2709If a class defines a non-callable `__init_subclass__` method/attribute, any attempt2710to subclass that class will raise a `TypeError` at runtime.27112712## Examples2713```python2714class Super:2715 __init_subclass__ = None27162717class Sub(Super): ... # error: [non-callable-init-subclass]2718```27192720## References2721- [Python data model: Customizing class creation](https://docs.python.org/3/reference/datamodel.html#customizing-class-creation)27222723# not-iterable27242725Default level: error | Stable (since 0.0.1-alpha.1)27262727## What it does2728Checks for objects that are not iterable but are used in a context that requires them to be.27292730## Why is this bad?2731Iterating over an object that is not iterable will raise a `TypeError` at runtime.27322733## Examples27342735```python2736for i in 34: # TypeError: 'int' object is not iterable2737 pass2738```27392740# not-subscriptable27412742Default level: error | Stable (since 0.0.1-alpha.1)27432744## What it does2745Checks for subscripting objects that do not support subscripting.27462747## Why is this bad?2748Subscripting an object that does not support it will raise a `TypeError` at runtime.27492750## Examples2751```python27524[1] # TypeError: 'int' object is not subscriptable2753```27542755# override-of-final-method27562757Default level: error | Stable (since 0.0.1-alpha.29)27582759## What it does2760Checks for methods on subclasses that override superclass methods decorated with `@final`.27612762## Why is this bad?2763Decorating a method with `@final` declares to the type checker that it should not be2764overridden on any subclass.27652766## Example27672768```python2769from typing import final27702771class A:2772 @final2773 def foo(self): ...27742775class B(A):2776 def foo(self): ... # Error raised here2777```27782779# override-of-final-variable27802781Default level: error | Stable (since 0.0.16)27822783## What it does2784Checks for class variables on subclasses that override a superclass variable2785that has been declared as `Final`.27862787## Why is this bad?2788Declaring a variable as `Final` indicates to the type checker that it should not be2789overridden on any subclass.27902791## Example27922793```python2794from typing import Final27952796class A:2797 X: Final[int] = 127982799class B(A):2800 X = 2 # Error raised here2801```28022803# parameter-already-assigned28042805Default level: error | Stable (since 0.0.1-alpha.1)28062807## What it does2808Checks for calls which provide more than one argument for a single parameter.28092810## Why is this bad?2811Providing multiple values for a single parameter will raise a `TypeError` at runtime.28122813## Examples28142815```python2816def f(x: int) -> int: ...28172818f(1, x=2) # Error raised here2819```28202821# positional-only-parameter-as-kwarg28222823Default level: error | Stable (since 0.0.1-alpha.22)28242825## What it does2826Checks for keyword arguments in calls that match positional-only parameters of the callable.28272828## Why is this bad?2829Providing a positional-only parameter as a keyword argument will raise `TypeError` at runtime.28302831## Example28322833```python2834def f(x: int, /) -> int: ...28352836f(x=1) # Error raised here2837```28382839# possibly-missing-attribute28402841Default level: ignore | Stable (since 0.0.1-alpha.22)28422843## What it does2844Checks for possibly missing attributes.28452846## Why is this bad?2847Attempting to access a missing attribute will raise an `AttributeError` at runtime.28482849## Rule status2850This rule is currently disabled by default because of the number of2851false positives it can produce.28522853## Examples2854```python2855class A:2856 if b:2857 c = 028582859A.c # AttributeError: type object 'A' has no attribute 'c'2860```28612862# possibly-missing-implicit-call28632864Default level: warn | Stable (since 0.0.1-alpha.22)28652866## What it does2867Checks for implicit calls to possibly missing methods.28682869## Why is this bad?2870Expressions such as `x[y]` and `x * y` call methods2871under the hood (`__getitem__` and `__mul__` respectively).2872Calling a missing method will raise an `AttributeError` at runtime.28732874## Examples2875```python2876import datetime28772878class A:2879 if datetime.date.today().weekday() != 6:2880 def __getitem__(self, v): ...28812882A()[0] # TypeError: 'A' object is not subscriptable2883```28842885# possibly-missing-import28862887Default level: ignore | Stable (since 0.0.1-alpha.22)28882889## What it does2890Checks for imports of symbols that may be missing.28912892## Why is this bad?2893Importing a missing module or name will raise a `ModuleNotFoundError`2894or `ImportError` at runtime.28952896## Rule status2897This rule is currently disabled by default because of the number of2898false positives it can produce.28992900## Examples2901```python2902# module.py2903import datetime29042905if datetime.date.today().weekday() != 6:2906 a = 129072908# main.py2909from module import a # ImportError: cannot import name 'a' from 'module'2910```29112912# possibly-missing-submodule29132914Default level: warn | Stable (since 0.0.23)29152916## What it does2917Checks for accesses of submodules that might not've been imported.29182919## Why is this bad?2920When module `a` has a submodule `b`, `import a` isn't generally enough to let you access2921`a.b.` You either need to explicitly `import a.b`, or else you need the `__init__.py` file2922of `a` to include `from . import b`. Without one of those, `a.b` is an `AttributeError`.29232924## Examples2925```python2926import html2927html.parser # AttributeError: module 'html' has no attribute 'parser'2928```29292930# possibly-unresolved-reference29312932Default level: ignore | Stable (since 0.0.1-alpha.1)29332934## What it does2935Checks for references to names that are possibly not defined.29362937## Why is this bad?2938Using an undefined variable will raise a `NameError` at runtime.29392940## Rule status2941This rule is currently disabled by default because of the number of2942false positives it can produce.29432944## Example29452946```python2947for i in range(0):2948 x = i29492950print(x) # NameError: name 'x' is not defined2951```29522953# raw-string-type-annotation29542955Default level: error | Stable (since 0.0.1-alpha.1)29562957## What it does2958Checks for raw-strings in type annotation positions.29592960## Why is this bad?2961Static analysis tools like ty can't analyze type annotations that use raw-string notation.29622963## Examples2964```python2965def test(): -> r"int":2966 ...2967```29682969Use instead:2970```python2971def test(): -> "int":2972 ...2973```29742975# redundant-cast29762977Default level: warn | Stable (since 0.0.1-alpha.1)29782979## What it does2980Detects redundant `cast` calls where the value already has the target type.29812982## Why is this bad?2983These casts have no effect and can be removed.29842985## Example2986```python2987def f() -> int:2988 return 1029892990cast(int, f()) # Redundant2991```29922993# redundant-final-classvar29942995Default level: warn | Stable (since 0.0.18)29962997## What it does2998Checks for redundant combinations of the `ClassVar` and `Final` type qualifiers.29993000## Why is this bad?3001An attribute that is marked `Final` in a class body is implicitly a class variable.3002Marking it as `ClassVar` is therefore redundant.30033004Note that this diagnostic is not emitted for dataclass fields, where3005`ClassVar[Final[int]]` has a distinct meaning from `Final[int]`.30063007## Examples3008```python3009from typing import ClassVar, Final30103011class C:3012 x: ClassVar[Final[int]] = 1 # redundant3013 y: Final[ClassVar[int]] = 1 # redundant3014```30153016# shadowed-type-variable30173018Default level: error | Stable (since 0.0.20)30193020## What it does3021Checks for type variables in nested generic classes or functions that shadow type variables3022from an enclosing scope.30233024## Why is this bad?3025Shadowing type variables makes the code confusing and is disallowed by the typing spec.30263027## Examples3028```python3029class Outer[T]:3030 # Error: `T` is already used by `Outer`3031 class Inner[T]: ...30323033 # Error: `T` is already used by `Outer`3034 def method[T](self, x: T) -> T: ...3035```30363037## References3038- [Typing spec: Generics](https://typing.python.org/en/latest/spec/generics.html#introduction)30393040# static-assert-error30413042Default level: error | Stable (since 0.0.1-alpha.1)30433044## What it does3045Makes sure that the argument of `static_assert` is statically known to be true.30463047## Why is this bad?3048A `static_assert` call represents an explicit request from the user3049for the type checker to emit an error if the argument cannot be verified3050to evaluate to `True` in a boolean context.30513052## Examples3053```python3054from ty_extensions import static_assert30553056static_assert(1 + 1 == 3) # error: evaluates to `False`30573058static_assert(int(2.0 * 3.0) == 6) # error: does not have a statically known truthiness3059```30603061# subclass-of-final-class30623063Default level: error | Stable (since 0.0.1-alpha.1)30643065## What it does3066Checks for classes that subclass final classes.30673068## Why is this bad?3069Decorating a class with `@final` declares to the type checker that it should not be subclassed.30703071## Example30723073```python3074from typing import final30753076@final3077class A: ...3078class B(A): ... # Error raised here3079```30803081# super-call-in-named-tuple-method30823083Default level: error | Stable (since 0.0.1-alpha.30)30843085## What it does3086Checks for calls to `super()` inside methods of `NamedTuple` classes.30873088## Why is this bad?3089Using `super()` in a method of a `NamedTuple` class will raise an exception at runtime.30903091## Examples3092```python3093from typing import NamedTuple30943095class F(NamedTuple):3096 x: int30973098 def method(self):3099 super() # error: super() is not supported in methods of NamedTuple classes3100```31013102## References3103- [Python documentation: super()](https://docs.python.org/3/library/functions.html#super)31043105# too-many-positional-arguments31063107Default level: error | Stable (since 0.0.1-alpha.1)31083109## What it does3110Checks for calls that pass more positional arguments than the callable can accept.31113112## Why is this bad?3113Passing too many positional arguments will raise `TypeError` at runtime.31143115## Example31163117```python3118def f(): ...31193120f("foo") # Error raised here3121```31223123# type-assertion-failure31243125Default level: error | Stable (since 0.0.1-alpha.1)31263127## What it does3128Checks for `assert_type()` and `assert_never()` calls where the actual type3129is not the same as the asserted type.31303131## Why is this bad?3132`assert_type()` allows confirming the inferred type of a certain value.31333134## Example31353136```python3137def _(x: int):3138 assert_type(x, int) # fine3139 assert_type(x, str) # error: Actual type does not match asserted type3140```31413142# unavailable-implicit-super-arguments31433144Default level: error | Stable (since 0.0.1-alpha.1)31453146## What it does3147Detects invalid `super()` calls where implicit arguments like the enclosing class or first method argument are unavailable.31483149## Why is this bad?3150When `super()` is used without arguments, Python tries to find two things:3151the nearest enclosing class and the first argument of the immediately enclosing function (typically self or cls).3152If either of these is missing, the call will fail at runtime with a `RuntimeError`.31533154## Examples3155```python3156super() # error: no enclosing class or function found31573158def func():3159 super() # error: no enclosing class or first argument exists31603161class A:3162 f = super() # error: no enclosing function to provide the first argument31633164 def method(self):3165 def nested():3166 super() # error: first argument does not exist in this nested function31673168 lambda: super() # error: first argument does not exist in this lambda31693170 (super() for _ in range(10)) # error: argument is not available in generator expression31713172 super() # okay! both enclosing class and first argument are available3173```31743175## References3176- [Python documentation: super()](https://docs.python.org/3/library/functions.html#super)31773178# unbound-type-variable31793180Default level: error | Stable (since 0.0.20)31813182## What it does3183Checks for type variables that are used in a scope where they are not bound3184to any enclosing generic context.31853186## Why is this bad?3187Using a type variable outside of a scope that binds it has no well-defined meaning.31883189## Examples3190```python3191from typing import TypeVar, Generic31923193T = TypeVar("T")3194S = TypeVar("S")31953196x: T # error: unbound type variable in module scope31973198class C(Generic[T]):3199 x: list[S] = [] # error: S is not in this class's generic context3200```32013202## References3203- [Typing spec: Scoping rules for type variables](https://typing.python.org/en/latest/spec/generics.html#scoping-rules-for-type-variables)32043205# undefined-reveal32063207Default level: warn | Stable (since 0.0.1-alpha.1)32083209## What it does3210Checks for calls to `reveal_type` without importing it.32113212## Why is this bad?3213Using `reveal_type` without importing it will raise a `NameError` at runtime.32143215## Examples3216```python3217reveal_type(1) # NameError: name 'reveal_type' is not defined3218```32193220# unknown-argument32213222Default level: error | Stable (since 0.0.1-alpha.1)32233224## What it does3225Checks for keyword arguments in calls that don't match any parameter of the callable.32263227## Why is this bad?3228Providing an unknown keyword argument will raise `TypeError` at runtime.32293230## Example32313232```python3233def f(x: int) -> int: ...32343235f(x=1, y=2) # Error raised here3236```32373238# unresolved-attribute32393240Default level: error | Stable (since 0.0.1-alpha.1)32413242## What it does3243Checks for unresolved attributes.32443245## Why is this bad?3246Accessing an unbound attribute will raise an `AttributeError` at runtime.3247An unresolved attribute is not guaranteed to exist from the type alone,3248so this could also indicate that the object is not of the type that the user expects.32493250## Examples3251```python3252class A: ...32533254A().foo # AttributeError: 'A' object has no attribute 'foo'3255```32563257# unresolved-global32583259Default level: warn | Stable (since 0.0.1-alpha.15)32603261## What it does3262Detects variables declared as `global` in an inner scope that have no explicit3263bindings or declarations in the global scope.32643265## Why is this bad?3266Function bodies with `global` statements can run in any order (or not at all), which makes3267it hard for static analysis tools to infer the types of globals without3268explicit definitions or declarations.32693270## Example3271```python3272def f():3273 global x # unresolved global3274 x = 4232753276def g():3277 print(x) # unresolved reference3278```32793280Use instead:32813282```python3283x: int32843285def f():3286 global x3287 x = 4232883289def g():3290 print(x)3291```32923293Or:32943295```python3296x: int | None = None32973298def f():3299 global x3300 x = 4233013302def g():3303 print(x)3304```33053306# unresolved-import33073308Default level: error | Stable (since 0.0.1-alpha.1)33093310## What it does3311Checks for import statements for which the module cannot be resolved.33123313## Why is this bad?3314Importing a module that cannot be resolved will raise a `ModuleNotFoundError`3315at runtime.33163317## Examples3318```python3319import foo # ModuleNotFoundError: No module named 'foo'3320```33213322# unresolved-reference33233324Default level: error | Stable (since 0.0.1-alpha.1)33253326## What it does3327Checks for references to names that are not defined.33283329## Why is this bad?3330Using an undefined variable will raise a `NameError` at runtime.33313332## Example33333334```python3335print(x) # NameError: name 'x' is not defined3336```33373338# unsupported-base33393340Default level: warn | Stable (since 0.0.1-alpha.7)33413342## What it does3343Checks for class definitions that have bases which are unsupported by ty.33443345## Why is this bad?3346If a class has a base that is an instance of a complex type such as a union type,3347ty will not be able to resolve the [method resolution order] (MRO) for the class.3348This will lead to an inferior understanding of your codebase and unpredictable3349type-checking behavior.33503351## Examples3352```python3353import datetime33543355class A: ...3356class B: ...33573358if datetime.date.today().weekday() != 6:3359 C = A3360else:3361 C = B33623363class D(C): ... # error: [unsupported-base]3364```33653366[method resolution order]: https://docs.python.org/3/glossary.html#term-method-resolution-order33673368# unsupported-bool-conversion33693370Default level: error | Stable (since 0.0.1-alpha.1)33713372## What it does3373Checks for bool conversions where the object doesn't correctly implement `__bool__`.33743375## Why is this bad?3376If an exception is raised when you attempt to evaluate the truthiness of an object,3377using the object in a boolean context will fail at runtime.33783379## Examples33803381```python3382class NotBoolable:3383 __bool__ = None33843385b1 = NotBoolable()3386b2 = NotBoolable()33873388if b1: # exception raised here3389 pass33903391b1 and b2 # exception raised here3392not b1 # exception raised here3393b1 < b2 < b1 # exception raised here3394```33953396# unsupported-dynamic-base33973398Default level: ignore | Stable (since 0.0.12)33993400## What it does3401Checks for dynamic class definitions (using `type()`) that have bases3402which are unsupported by ty.34033404This is equivalent to `unsupported-base` but applies to classes created3405via `type()` rather than `class` statements.34063407## Why is this bad?3408If a dynamically created class has a base that is an unsupported type3409such as `type[T]`, ty will not be able to resolve the3410[method resolution order] (MRO) for the class. This may lead to an inferior3411understanding of your codebase and unpredictable type-checking behavior.34123413## Default level3414This rule is disabled by default because it will not cause a runtime error,3415and may be noisy on codebases that use `type()` in highly dynamic ways.34163417## Examples3418```python3419def factory(base: type[Base]) -> type:3420 # `base` has type `type[Base]`, not `type[Base]` itself3421 return type("Dynamic", (base,), {}) # error: [unsupported-dynamic-base]3422```34233424[method resolution order]: https://docs.python.org/3/glossary.html#term-method-resolution-order34253426# unsupported-operator34273428Default level: error | Stable (since 0.0.1-alpha.1)34293430## What it does3431Checks for binary expressions, comparisons, and unary expressions where3432the operands don't support the operator.34333434## Why is this bad?3435Attempting to use an unsupported operator will raise a `TypeError` at3436runtime.34373438## Examples3439```python3440class A: ...34413442A() + A() # TypeError: unsupported operand type(s) for +: 'A' and 'A'3443```34443445# unused-awaitable34463447Default level: warn | Preview (since 0.0.21)34483449## What it does3450Checks for awaitable objects (such as coroutines) used as expression3451statements without being awaited.34523453## Why is this bad?3454Calling an `async def` function returns a coroutine object. If the3455coroutine is never awaited, the body of the async function will never3456execute, which is almost always a bug. Python emits a3457`RuntimeWarning: coroutine was never awaited` at runtime in this case.34583459## Examples3460```python3461async def fetch_data() -> str:3462 return "data"34633464async def main() -> None:3465 fetch_data() # Warning: coroutine is not awaited3466 await fetch_data() # OK3467```34683469# unused-ignore-comment34703471Default level: warn | Stable (since 0.0.1-alpha.1)34723473test rule::rule_unknown ... ok3474## What it does3475Checks for `ty: ignore` directives that are no longer applicable.34763477## Why is this bad?3478A `ty: ignore` directive that no longer matches any diagnostic violations is likely3479included by mistake, and should be removed to avoid confusion.34803481## Examples3482```py3483a = 20 / 2 # ty: ignore[division-by-zero]3484```34853486Use instead:34873488```py3489a = 20 / 23490```34913492## Options3493Set [`analysis.respect-type-ignore-comments`](https://docs.astral.sh/ty/reference/configuration/#respect-type-ignore-comments)3494to `false` to prevent this rule from reporting unused `type: ignore` comments.34953496# unused-type-ignore-comment34973498Default level: warn | Stable (since 0.0.14)34993500## What it does3501Checks for `type: ignore` directives that are no longer applicable.35023503## Why is this bad?3504A `type: ignore` directive that no longer matches any diagnostic violations is likely3505included by mistake, and should be removed to avoid confusion.35063507## Examples3508```py3509a = 20 / 2 # type: ignore3510```35113512Use instead:35133514```py3515a = 20 / 23516```35173518## Options35193520This rule is skipped if [`analysis.respect-type-ignore-comments`](https://docs.astral.sh/ty/reference/configuration/#respect-type-ignore-comments)3521to `false`.35223523# useless-overload-body35243525Default level: warn | Stable (since 0.0.1-alpha.22)35263527## What it does3528Checks for various `@overload`-decorated functions that have non-stub bodies.35293530## Why is this bad?3531Functions decorated with `@overload` are ignored at runtime; they are overridden3532by the implementation function that follows the series of overloads. While it is3533not illegal to provide a body for an `@overload`-decorated function, it may indicate3534a misunderstanding of how the `@overload` decorator works.35353536## Example35373538```py3539from typing import overload35403541@overload3542def foo(x: int) -> int:3543 return x + 1 # will never be executed35443545@overload3546def foo(x: str) -> str:3547 return "Oh no, got a string" # will never be executed35483549def foo(x: int | str) -> int | str:3550 raise Exception("unexpected type encountered")3551```35523553Use instead:35543555```py3556from typing import assert_never, overload35573558@overload3559def foo(x: int) -> int: ...35603561@overload3562def foo(x: str) -> str: ...35633564def foo(x: int | str) -> int | str:3565 if isinstance(x, int):3566 return x + 13567 elif isinstance(x, str):3568 return "Oh no, got a string"3569 else:3570 assert_never(x)3571```35723573## References3574- [Python documentation: `@overload`](https://docs.python.org/3/library/typing.html#typing.overload)35753576# zero-stepsize-in-slice35773578Default level: error | Stable (since 0.0.1-alpha.1)35793580## What it does3581Checks for step size 0 in slices.35823583## Why is this bad?3584A slice with a step size of zero will raise a `ValueError` at runtime.35853586## Examples3587```python3588l = list(range(10))3589l[1:10:0] # ValueError: slice step cannot be zero3590```35913592test rule::rule_no_selector ... ok3593test python_environment::src_subdirectory_not_added_as_root_if_src_package_exists ... ok3594test rule_selection::all_overrides ... ok3595test rule_selection::cli_all_rules_ignore ... ok3596test rule_selection::cli_all_rules_precedence ... ok3597test rule_selection::cli_all_rules_warn ... ok3598test rule_selection::cli_specific_then_all ... ok3599test rule_selection::cli_unknown_rules ... ok3600test rule_selection::configuration_all_rules ... ok3601test rule_selection::cli_rule_severity_precedence ... ok3602test rule_selection::configuration_all_rules_with_rule_sorting_before_all ... ok3603test rule_selection::cli_rule_severity ... ok3604test rule_selection::overrides_basic ... ok3605test rule_selection::configuration_unknown_rules ... ok3606test rule_selection::overrides_all_rules_with_rule_sorting_before_all ... ok3607test rule_selection::configuration_rule_severity ... ok3608test rule_selection::overrides_empty_include ... ok3609test rule_selection::overrides_exclude ... ok3610test rule_selection::overrides_invalid_exclude_glob ... ok3611test rule_selection::overrides_inherit_global ... ok3612test rule_selection::overrides_invalid_include_glob ... ok3613test rule_selection::overrides_missing_include_exclude ... ok3614test rule_selection::overrides_precedence ... ok3615test rule_selection::overrides_no_actual_overrides ... ok3616test rule_selection::overrides_unknown_rules ... ok3617test test_include_hidden_files_by_default ... ok3618test test_run_in_sub_directory ... ok3619test test_output_format_env ... ok3620test test_respect_ignore_files ... ok3621test user_configuration ... ok3622test test_quiet_output ... ok36233624test result: ok. 123 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 2.94s36253626 Running tests/file_watching.rs (/build/source/target/aarch64-unknown-linux-gnu/release/deps/file_watching-199ba404bf245657)36273628running 38 tests3629test active_project_config_change_reloads_project ... ok3630test changed_file ... ok3631test add_search_path ... ok3632test changed_versions_file ... ok3633test changes_to_config_file_override ... ok3634test deleted_file ... ok3635test changes_to_user_configuration ... ok3636test change_python_version_and_platform ... ok3637test directory_deleted ... ok3638test directory_moved_to_trash ... ok3639test hard_links_to_target_outside_project ... ignored, inotify doesn't support observing changes to hard linked files.3640test directory_moved_to_project ... ok3641test directory_renamed ... ok3642test hard_links_in_project ... ok3643test move_file_to_project ... ok3644test ignore_file_change_reloads_files_not_project_metadata ... ok3645test move_file_to_trash ... ok3646test nested_project_config_change_is_cheap_if_active_project_unchanged ... ok3647test nested_projects_delete_root ... ok3648test new_file ... ok3649test new_file_in_included_out_of_project_directory ... ok3650test new_files_with_explicit_included_paths ... ok3651test new_ignored_file ... ok3652test new_non_project_file ... ok3653test rename_files_casing_only ... ignored3654test reloading_options_updates_inferred_python_version_diagnostics_when_metadata_is_unchanged ... ok3655test rename_file ... ok3656test search_path ... ok3657test src_file_filter_change_reloads_project_files ... ok3658test remove_search_path ... ok3659test submodule_cache_invalidation_created ... ok3660test submodule_cache_invalidation_after_pyproject_created ... ok3661test submodule_cache_invalidation_deleted ... ok3662test submodule_cache_invalidation_created_then_deleted ... ok3663test unix::changed_metadata ... ok3664test unix::symlink_inside_project ... ok3665test unix::symlinked_module_search_path ... ok3666test unix::symlink_target_outside_watched_paths ... ok36673668test result: ok. 36 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.89s36693670 Running unittests src/lib.rs (/build/source/target/aarch64-unknown-linux-gnu/release/deps/ty_python_semantic-dd2b989b4ac487c2)36713672running 237 tests3673test diagnostic::levenshtein::tests::non_underscored_names_always_suggested_even_if_typo_underscored::_bluch_expects ... ok3674test diagnostic::levenshtein::tests::non_underscored_names_always_suggested_even_if_typo_underscored::_luch_expects ... ok3675test diagnostic::levenshtein::tests::test_bad_suggestions_do_not_trigger_for_small_names::_b_expects ... ok3676test diagnostic::levenshtein::tests::test_bad_suggestions_do_not_trigger_for_small_names::_m_expects ... ok3677test diagnostic::levenshtein::tests::test_bad_suggestions_do_not_trigger_for_small_names::_py_expects ... ok3678test diagnostic::levenshtein::tests::test_bad_suggestions_do_not_trigger_for_small_names::_v_expects ... ok3679test diagnostic::levenshtein::tests::test_good_suggestions::case_changes_are_preferred_over_substitutions ... ok3680test diagnostic::levenshtein::tests::test_good_suggestions::eliminations_are_preferred_over_additions ... ok3681test diagnostic::levenshtein::tests::test_good_suggestions::substitutions_are_preferred_over_eliminations ... ok3682test diagnostic::levenshtein::tests::test_good_suggestions::test_for_additional_characters ... ok3683test diagnostic::levenshtein::tests::test_good_suggestions::substitutions_are_preferred_over_additions ... ok3684test diagnostic::levenshtein::tests::test_good_suggestions::test_for_eliminated_characters ... ok3685test diagnostic::levenshtein::tests::test_good_suggestions::test_for_substituted_characters ... ok3686test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_0_2_expects ... ok3687test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_0_expects ... ok3688test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_a_2_expects ... ok3689test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_aa_bb_4_expects ... ok3690test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_aaaaa_aaaaa_5_expects ... ok3691test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_aba_aab_4_expects ... ok3692test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_a_a_1_expects ... ok3693test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_abc_y_6_expects ... ok3694test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_abstractfoobarmanager_abstract_foobar_manager_3_2_2_expects ... ok3695test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_apple_aple_2_expects ... ok3696test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_attributeerror_attributeerrop_2_expects ... ok3697test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_attributeerror_attributeerrortests_10_expects ... ok3698test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_banana_b_n_n_6_expects ... ok3699test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_cherry_cherry_2_expects ... ok3700test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_cpython_pypy_10_expects ... ok3701test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_cpython_pypy_11_expects ... ok3702test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_java_c_8_expects ... ok3703test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_python_java_12_expects ... ok3704test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_wxyz_wxyz123_8_expects ... ok3705test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_cpython_examples::_wxyz_wxyz_2_expects ... ok3706test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_wikipedia_examples::_flaw_lawn_4_expects ... ok3707test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_wikipedia_examples::_kitten_sitting_6_expects ... ok3708test diagnostic::levenshtein::tests::test_levenshtein_distance_calculation_wikipedia_examples::_uninformed_uniformed_2_expects ... ok3709test diagnostic::levenshtein::tests::test_no_suggestion_for_very_different_name ... ok3710test diagnostic::levenshtein::tests::underscored_names_are_suggested_if_hide_policy_set_to_yes_when_typo_is_underscored::_blach_expects ... ok3711test diagnostic::levenshtein::tests::underscored_names_are_suggested_if_hide_policy_set_to_yes_when_typo_is_underscored::_luch_expects ... ok3712test diagnostic::levenshtein::tests::underscored_names_not_suggested_if_hide_policy_set_to_yes ... ok3713test fixes::tests::arguments ... ok3714test fixes::tests::dont_fix_files_containing_syntax_errors ... ok3715test fixes::tests::existing_ty_ignore ... ok3716test fixes::tests::dont_fix_unused_ignore ... ok3717test fixes::tests::fix_cancellation_reverts_changes ... ok3718test fixes::tests::fix_overlapping_diagnostics_requires_multiple_iterations ... ok3719test fixes::tests::fix_syntax_error ... ok3720test fixes::tests::fix_non_convergence ... ok3721test fixes::tests::multiple_suppressions_same_code ... ok3722test fixes::tests::multiple_suppressions_different_codes ... ok3723test place::implicit_globals::tests::module_type_symbols_includes_declared_types_but_not_referenced_types ... ok3724test fixes::tests::return_type ... ok3725test fixes::tests::simple_suppression ... ok3726test fixes::tests::same_code_multiline_suppressions_with_different_ranges_can_become_redundant ... ok3727test place::tests::implicit_builtin_globals ... ok3728test place::tests::test_symbol_or_fall_back_to ... ok3729test semantic_model::tests::alias_type ... ok3730test place::tests::implicit_sys_globals ... ok3731test semantic_model::tests::class_type ... ok3732test semantic_model::tests::function_type ... ok3733test subscript::tests::py_index_empty ... ok3734test subscript::tests::py_index_more_elements ... ok3735test subscript::tests::py_index_single_element ... ok3736test subscript::tests::py_index_uses_full_index_range ... ok3737test subscript::tests::py_slice_empty_input ... ok3738test subscript::tests::py_slice_mixed_positive_negative_indices ... ok3739test subscript::tests::py_slice_negative_indices ... ok3740test subscript::tests::py_slice_nonnegative_indices ... ok3741test subscript::tests::py_slice_single_element_input ... ok3742test subscript::tests::py_slice_step_backward ... ok3743test subscript::tests::py_slice_step_forward ... ok3744test suppression::parser::tests::fmt_comment_before_type_ignore ... ok3745test suppression::parser::tests::invalid_type_ignore_valid_type_ignore ... ok3746test suppression::parser::tests::multiple_type_ignore_comments ... ok3747test suppression::parser::tests::type_ignore_before_fmt_off ... ok3748test suppression::parser::tests::type_ignore_explanation ... ok3749test suppression::parser::tests::type_ignore_multiple_codes ... ok3750test suppression::parser::tests::type_ignore_no_codes ... ok3751test suppression::parser::tests::type_ignore_single_code ... ok3752test suppression::parser::tests::valid_type_ignore_invalid_type_ignore ... ok3753test place::tests::implicit_typing_extensions_globals ... ok3754test place::tests::implicit_typing_globals ... ok3755test types::call::arguments::tests::expand_tuple_type ... ok3756test types::call::arguments::tests::expand_bool_type ... ok3757test types::call::arguments::tests::expand_union_type ... ok3758test types::class::known::tests::known_class_roundtrip_from_str ... ok3759test types::constraints::tests::tdd_bare_constraints_have_no_uncertain_branches ... ok3760test types::constraints::tests::tdd_double_negation ... ok3761test types::class::known::tests::known_class_doesnt_fallback_to_unknown_unexpectedly_on_latest_version ... ok3762test types::constraints::tests::tdd_iff_self ... ok3763test types::constraints::tests::tdd_negation_correctness ... ok3764test types::constraints::tests::tdd_intersection_preserves_uncertain ... ok3765test types::constraints::tests::tdd_negation_produces_flat_tdd ... ok3766test types::constraints::tests::tdd_owned_round_trip ... ok3767test types::constraints::tests::tdd_union_creates_uncertain_branches ... ok3768test types::constraints::tests::test_display_graph_output ... ok3769test types::display::tests::string_literal_display ... ok3770test types::display::tests::signature_display ... ok3771test types::display::tests::signature_display_multiline ... ok3772test types::class::known::tests::known_class_doesnt_fallback_to_unknown_unexpectedly_on_low_python_version ... ok3773test types::ide_support::tests::call_argument_forms_fast_path_value_only_signatures ... ok3774test types::function::tests::known_function_roundtrip_from_str ... ok3775test types::ide_support::tests::conditional_special_forms_degrade_to_unknown_for_positional_arguments ... ok3776test types::ide_support::tests::conditional_special_forms_preserve_type_form_information ... ok3777test types::ide_support::tests::keyword_call_argument_forms_follow_source_order ... ok3778test types::ide_support::tests::successful_call_argument_forms_ignore_failed_bindings ... ok3779test types::ide_support::unreachable_code::tests::does_not_report_type_checking_block_as_unreachable ... ok3780test types::ide_support::tests::overloaded_call_argument_forms_follow_source_order ... ok3781test types::ide_support::unreachable_code::tests::does_not_report_conditional_noreturn_tail_as_unreachable ... ok3782test types::ide_support::unreachable_code::tests::keeps_reachable_code_before_return_out_of_results ... ok3783test types::ide_support::unreachable_code::tests::keeps_separate_unreachable_regions_separate ... ok3784test types::ide_support::unreachable_code::tests::merges_consecutive_unreachable_statements ... ok3785test types::ide_support::unreachable_code::tests::merges_unreachable_comprehension_scope_into_enclosing_block ... ok3786test types::ide_support::unreachable_code::tests::merges_unreachable_other_comprehension_scopes_into_enclosing_blocks ... ok3787test types::ide_support::tests::variadic_call_argument_forms_are_unknown_when_matched_to_multiple_parameters ... ok3788test types::ide_support::unreachable_code::tests::merges_unreachable_scope_range_into_enclosing_block ... ok3789test types::ide_support::unreachable_code::tests::reports_else_branch_after_true_condition ... ok3790test types::ide_support::unreachable_code::tests::reports_false_branch_from_statically_known_arithmetic ... ok3791test types::ide_support::unreachable_code::tests::reports_false_branch_statement ... ok3792test types::ide_support::unreachable_code::tests::reports_platform_guarded_branch_as_current_analysis_unreachable ... ok3793test types::ide_support::unreachable_code::tests::reports_statement_after_always_taken_terminating_branch ... ok3794test types::ide_support::unreachable_code::tests::reports_statement_after_assert_false ... ok3795test types::ide_support::unreachable_code::tests::reports_statement_after_break ... ok3796test types::ide_support::unreachable_code::tests::reports_statement_after_chained_always_taken_terminating_branch ... ok3797test types::ide_support::unreachable_code::tests::reports_statement_after_continue ... ok3798test types::ide_support::unreachable_code::tests::reports_statement_after_infinite_loop ... ok3799test types::ide_support::unreachable_code::tests::reports_statement_after_raise ... ok3800test types::ide_support::unreachable_code::tests::reports_statement_after_raise_inside_try ... ok3801test types::ide_support::unreachable_code::tests::reports_statement_after_return ... ok3802test types::ide_support::unreachable_code::tests::reports_statement_in_unreachable_elif_branch ... ok3803test types::ide_support::unreachable_code::tests::reports_unreachable_class_definition ... ok3804test types::ide_support::unreachable_code::tests::reports_unreachable_function_definition ... ok3805test types::ide_support::unreachable_code::tests::reports_unreachable_ternary_branch ... ok3806test types::ide_support::unreachable_code::tests::reports_unreachable_type_alias ... ok3807test types::ide_support::unreachable_code::tests::reports_noreturn_tail_as_current_analysis_unreachable ... ok3808test types::ide_support::unreachable_code::tests::reports_while_false_body_statement ... ok3809test types::ide_support::unused_binding_support::tests::captures_safe_local_binding_kinds ... ok3810test types::ide_support::unused_binding_support::tests::captures_unused_function_and_lambda_parameters ... ok3811test types::ide_support::unused_binding_support::tests::closure_uses_nearest_shadowed_binding ... ok3812test types::ide_support::unreachable_code::tests::merges_overlapping_ranges_of_different_kinds ... ok3813test types::ide_support::unused_binding_support::tests::comprehension_binding_captured_by_nested_lambda_is_used ... ok3814test types::ide_support::unreachable_code::tests::keeps_reachable_code_after_unreachable_statement_out_of_results ... ok3815test types::ide_support::unused_binding_support::tests::nested_local_same_name_does_not_mark_outer_used ... ok3816test types::ide_support::unused_binding_support::tests::nonlocal_proxy_scope_still_marks_outer_binding_used ... ok3817test types::ide_support::unused_binding_support::tests::does_not_report_used_parameter_on_syntax_error ... ok3818test types::ide_support::unused_binding_support::tests::overriding_method_reports_unused_local_bindings ... ok3819test types::ide_support::unused_binding_support::tests::reports_dead_annotation_only_declaration ... ok3820test types::ide_support::unused_binding_support::tests::reports_unused_parameter_for_indirect_override ... ok3821test types::ide_support::unused_binding_support::tests::reports_non_parameter_self_and_cls_bindings ... ok3822test types::ide_support::unused_binding_support::tests::reports_unused_parameter_for_non_overriding_method ... ok3823test types::ide_support::unused_binding_support::tests::reports_unused_parameter_for_overriding_method ... ok3824test types::ide_support::unused_binding_support::tests::skips_annotation_only_declaration_before_reassignment ... ok3825test types::ide_support::unused_binding_support::tests::skips_annotation_only_declaration_before_unused_binding ... ok3826test types::ide_support::unused_binding_support::tests::reports_unused_binding_on_syntax_error ... ok3827test types::ide_support::unused_binding_support::tests::skips_closure_captured_bindings ... ok3828test types::ide_support::unused_binding_support::tests::skips_global_and_nonlocal_assignments ... ok3829test types::ide_support::unused_binding_support::tests::skips_module_and_class_scope_bindings ... ok3830test types::ide_support::unused_binding_support::tests::skips_placeholder_and_dunder_locals ... ok3831test types::ide_support::unused_binding_support::tests::skips_unreachable_loop_carried_rebinding ... ok3832test types::ide_support::unused_binding_support::tests::skips_unused_parameter_for_method_with_stub_body ... ok3833test types::ide_support::unused_binding_support::tests::skips_unused_parameter_for_module_level_overload_stub_declarations ... ok3834test types::ide_support::unreachable_code::tests::reports_version_guarded_branch_as_current_analysis_unreachable ... ok3835test types::ide_support::unused_binding_support::tests::skips_unused_parameters_in_stub_files ... ok3836test types::ide_support::unused_binding_support::tests::skips_unused_parameter_for_overload_stub_declarations ... ok3837test types::ide_support::unused_binding_support::tests::skips_loop_condition_guarded_rebinding ... ok3838test types::ide_support::unused_binding_support::tests::skips_loop_carried_rebinding ... ok3839test types::infer::tests::call_type_doesnt_rerun_when_only_callee_changed ... ok3840test types::infer::tests::adding_string_literals_and_literal_string ... ok3841test types::infer::tests::dependency_internal_symbol_change ... ok3842test types::infer::tests::dependency_implicit_class_member ... ok3843test types::infer::tests::dependency_implicit_instance_attribute ... ok3844test types::infer::tests::dependency_own_instance_member ... ok3845test types::infer::tests::dependency_unrelated_symbol ... ok3846test types::infer::tests::dependency_public_symbol_type_change ... ok3847test types::infer::tests::multiplied_literal_string ... ok3848test types::infer::tests::multiplied_string ... ok3849test types::infer::tests::not_literal_string ... ok3850test types::property_tests::flaky::all_type_pairs_are_supertypes_of_their_intersection ... ignored3851test types::property_tests::flaky::all_type_pairs_can_be_assigned_from_their_intersection ... ignored3852test types::property_tests::flaky::bottom_materialization_of_type_is_assignable_to_type ... ignored3853test types::property_tests::flaky::constituent_members_of_union_is_not_disjoint_from_that_union ... ignored3854test types::property_tests::flaky::double_negation_is_identity ... ignored3855test types::property_tests::flaky::intersection_equivalence_not_order_dependent ... ignored3856test types::property_tests::flaky::negation_of_fully_static_types_is_disjoint ... ignored3857test types::property_tests::flaky::negation_reverses_subtype_order ... ignored3858test types::property_tests::flaky::top_materialization_of_type_is_assignable_to_type ... ignored3859test types::property_tests::flaky::union_equivalence_not_order_dependent ... ignored3860test types::property_tests::stable::all_fully_static_type_pairs_are_subtype_of_their_union ... ignored3861test types::property_tests::stable::all_negated_types_identical_to_intersection_with_single_negated_element ... ignored3862test types::property_tests::stable::all_type_pairs_are_assignable_to_their_union ... ignored3863test types::property_tests::stable::all_types_assignable_to_iterable_are_iterable ... ignored3864test types::property_tests::stable::all_types_assignable_to_object ... ignored3865test types::property_tests::stable::all_types_subtype_of_object ... ignored3866test types::property_tests::stable::assignable_to_is_reflexive ... ignored3867test types::property_tests::stable::bottom_callable_is_subtype_of_all_callable ... ignored3868test types::property_tests::stable::disjoint_from_is_irreflexive ... ignored3869test types::property_tests::stable::disjoint_from_is_symmetric ... ignored3870test types::property_tests::stable::equivalent_to_is_commutative ... ignored3871test types::property_tests::stable::equivalent_to_is_reflexive ... ignored3872test types::property_tests::stable::equivalent_to_is_symmetric ... ignored3873test types::property_tests::stable::equivalent_to_is_transitive ... ignored3874test types::property_tests::stable::never_assignable_to_every_type ... ignored3875test types::property_tests::stable::never_subtype_of_every_type ... ignored3876test types::property_tests::stable::only_never_is_subtype_of_any ... ignored3877test types::property_tests::stable::only_object_is_supertype_of_any ... ignored3878test types::property_tests::stable::singleton_implies_single_valued ... ignored3879test types::property_tests::stable::subtype_of_implies_assignable_to ... ignored3880test types::property_tests::stable::subtype_of_implies_not_disjoint_from ... ignored3881test types::property_tests::stable::subtype_of_is_antisymmetric ... ignored3882test types::property_tests::stable::subtype_of_is_reflexive_for_fully_static_types ... ignored3883test types::property_tests::stable::subtype_of_is_transitive ... ignored3884test types::set_theoretic::builder::tests::build_intersection_empty_intersection_equals_object ... ok3885test types::infer::tests::pep695_type_params ... ok3886test types::infer::tests::truncated_string_literals_become_literal_string ... ok3887test types::set_theoretic::builder::tests::build_union_no_elements ... ok3888test types::set_theoretic::builder::tests::build_union_single_element ... ok3889test types::set_theoretic::builder::tests::build_union_two_elements ... ok3890test types::infer::tests::unbound_symbol_no_reachability_constraint_check ... ok3891test types::set_theoretic::builder::tests::build_intersection_simplify_split_bool ... ok3892test types::set_theoretic::builder::tests::build_intersection_enums ... ok3893test types::signatures::tests::empty ... ok3894test types::set_theoretic::builder::tests::map_preserves_alias_unpacking_behavior ... ok3895test types::set_theoretic::builder::tests::map_rebuilds_prefix_for_literal_widening ... ok3896test types::signatures::tests::deferred_in_stub ... ok3897test types::signatures::tests::external_signature_no_decorator ... ok3898test types::signatures::tests::generic_deferred_in_stub ... ok3899test types::signatures::tests::full ... ok3900test types::signatures::tests::generic_not_deferred ... ok3901test types::signatures::tests::not_deferred ... ok3902test types::tests::divergent_type ... ok3903test types::tests::no_default_type_is_singleton::pythonversion_py312_expects ... ok3904test types::tests::eager_expansion ... ok3905test types::tests::no_default_type_is_singleton::pythonversion_py313_expects ... ok3906test types::typed_dict::test_btreemap_overlapping_items ... ok3907test types::tests::todo_types ... ok3908test types::tests::typing_vs_typeshed_no_default ... ok3909test types::tests::type_alias_variance ... ok39103911test result: ok. 203 passed; 0 failed; 34 ignored; 0 measured; 0 filtered out; finished in 0.79s39123913 Running tests/corpus.rs (/build/source/target/aarch64-unknown-linux-gnu/release/deps/corpus-c3812c702db51064)39143915running 14 tests3916test linter_no_panic::_a_z_expects ... ok3917test linter_no_panic::_a_e_expects ... ok3918test linter_no_panic::_g_o_expects ... ok3919test corpus_no_panic ... ok3920test linter_stubs_no_panic ... ok3921test parser_no_panic ... ok3922test linter_no_panic::_q_z_expects ... ok3923test linter_no_panic::_p_expects ... ok3924test typeshed_no_panic::_a_e_expects ... ok3925test typeshed_no_panic::_a_z_expects ... ok3926test typeshed_no_panic::_f_k_expects ... ok3927test typeshed_no_panic::_l_p_expects ... ok3928test linter_no_panic::_f_expects ... ok3929test typeshed_no_panic::_q_z_expects ... ok39303931test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.79s39323933 Running tests/mdtest.rs (/build/source/target/aarch64-unknown-linux-gnu/release/deps/mdtest-eea2ad32045e02da)39343935running 335 tests3936test mdtest::annotations/int_float_complex.md ... ok3937test mdtest::annotations/annotated.md ... ok3938test mdtest::annotations/any.md ... ok3939test mdtest::annotations/starred.md ... ok3940test mdtest::abstract.md ... ok3941test mdtest::annotations/generic_alias.md ... ok3942test mdtest::annotations/optional.md ... ok3943test mdtest::annotations/stdlib_typing_aliases.md ... ok3944test mdtest::assignment/multi_target.md ... ok3945test mdtest::annotations/union.md ... ok3946test mdtest::annotations/literal_string.md ... ok3947test mdtest::assignment/augmented.md ... ok3948test mdtest::annotations/unsupported_type_qualifiers.md ... ok3949test mdtest::annotations/literal.md ... ok3950test mdtest::assignment/unbound.md ... ok3951test mdtest::annotations/unsupported_special_types.md ... ok3952test mdtest::annotations/never.md ... ok3953test mdtest::assignment/walrus.md ... ok3954test mdtest::annotations/callable.md ... ok3955test mdtest::binary/booleans.md ... ok3956test mdtest::annotations/deferred.md ... ok3957test mdtest::binary/tuples.md ... ok3958test mdtest::binary/unions.md ... ok3959test mdtest::binary/integers.md ... ok3960test mdtest::binary/custom.md ... ok3961test mdtest::annotations/new_types.md ... ok3962test mdtest::call/annotation.md ... ok3963test mdtest::annotations/unsupported_special_forms.md ... ok3964test mdtest::annotations/string.md ... ok3965test mdtest::binary/instances.md ... ok3966test mdtest::boolean/short_circuit.md ... ok3967test mdtest::binary/classes.md ... ok3968test mdtest::call/callable_instance.md ... ok3969test mdtest::call/builtins.md ... ok3970test mdtest::boundness_declaredness/public.md ... ok3971test mdtest::call/abstract_method.md ... ok3972test mdtest::call/dunder_import.md ... ok3973test mdtest::bidirectional.md ... ok3974test mdtest::call/callables_as_descriptors.md ... ok3975test mdtest::call/invalid_syntax.md ... ok3976test mdtest::call/dunder.md ... ok3977test mdtest::annotations/invalid.md ... ok3978test mdtest::call/getattr_static.md ... ok3979test mdtest::call/never.md ... ok3980test mdtest::call/replace.md ... ok3981test mdtest::call/str_startswith.md ... ok3982test mdtest::annotations/self.md ... ok3983test mdtest::async.md ... ok3984test mdtest::call/subclass_of.md ... ok3985test mdtest::call/new_class.md ... ok3986test mdtest::call/open.md ... ok3987test mdtest::comparison/enums.md ... ok3988test mdtest::comparison/byte_literals.md ... ok3989test mdtest::comparison/identity.md ... ok3990test mdtest::classes.md ... ok3991test mdtest::comparison/integers.md ... ok3992test mdtest::comparison/instances/membership_test.md ... ok3993test mdtest::comparison/non_bool_returns.md ... ok3994test mdtest::comparison/strings.md ... ok3995test mdtest::comparison/instances/rich_comparison.md ... ok3996test mdtest::comparison/intersections.md ... ok3997test mdtest::call/type.md ... ok3998test mdtest::comprehensions/invalid_syntax.md ... ok3999test mdtest::comparison/unions.md ... ok4000test mdtest::comparison/unsupported.md ... ok4001test mdtest::conditional/if_expression.md ... ok4002test mdtest::conditional/if_statement.md ... ok4003test mdtest::comparison/tuples.md ... ok4004test mdtest::cycle.md ... ok4005test mdtest::conditional/match.md ... ok4006test mdtest::call/functools_partial.md ... ok4007test mdtest::comprehensions/basic.md ... ok4008test mdtest::dataclasses/post_init.md ... ok4009test mdtest::call/methods.md ... ok4010test mdtest::declaration/error.md ... ok4011test mdtest::assignment/annotations.md ... ok4012test mdtest::dataclasses/fields.md ... ok4013test mdtest::del.md ... ok4014test mdtest::attributes.md ... ok4015test mdtest::dataclasses/dataclass_transform.md ... ok4016test mdtest::call/constructor.md ... ok4017test mdtest::call/function.md ... ok4018test mdtest::diagnostics/attribute_assignment.md ... ok4019test mdtest::class/super.md ... ok4020test mdtest::decorators.md ... ok4021test mdtest::decorators/total_ordering.md ... ok4022test mdtest::diagnostics/invalid_type_parameter_order.md ... ok4023test mdtest::diagnostics/invalid_assignment_syntactic_variants.md ... ok4024test mdtest::diagnostics/missing_argument_paramspec.md ... ok4025test mdtest::diagnostics/missing_argument.md ... ok4026test mdtest::call/overloads.md ... ok4027test mdtest::deprecated.md ... ok4028test mdtest::diagnostics/invalid_await.md ... ok4029test mdtest::diagnostics/legacy_typevars.md ... ok4030test mdtest::descriptor_protocol.md ... ok4031test mdtest::diagnostics/error_context.md ... ok4032test mdtest::call/union.md ... ok4033test mdtest::diagnostics/shadowing.md ... ok4034test mdtest::diagnostics/no_matching_overload.md ... ok4035test mdtest::diagnostics/same_names.md ... ok4036test mdtest::diagnostics/single_matching_overload.md ... ok4037test mdtest::diagnostics/special_form_attributes.md ... ok4038test mdtest::diagnostics/too_many_positionals.md ... ok4039test mdtest::diagnostics/unknown_argument.md ... ok4040test mdtest::doc/README.md ... ok4041test mdtest::diagnostics/unpacking.md ... ok4042test mdtest::diagnostics/unresolved_import.md ... ok4043test mdtest::diagnostics/unsupported_base_dynamic_type.md ... ok4044test mdtest::diagnostics/unsupported_bool_conversion.md ... ok4045test mdtest::diagnostics/unresolved_reference.md ... ok4046test mdtest::diagnostics/union_call.md ... ok4047test mdtest::directives/assert_never.md ... ok4048test mdtest::diagnostics/unused_awaitable.md ... ok4049test mdtest::doc/public_type_undeclared_symbols.md ... ok4050test mdtest::directives/reveal_type.md ... ok4051test mdtest::diagnostics/invalid_argument_type.md ... ok4052test mdtest::exception/invalid_syntax.md ... ok4053test mdtest::expression/assert.md ... ok4054test mdtest::diagnostics/version_related_syntax_errors.md ... ok4055test mdtest::external/README.md ... ok4056test mdtest::external/attrs.md ... ok4057test mdtest::external/numpy.md ... ok4058test mdtest::exception/except_star.md ... ok4059test mdtest::external/pydantic.md ... ok4060test mdtest::external/sqlalchemy.md ... ok4061test mdtest::directives/assert_type.md ... ok4062test mdtest::external/sqlmodel.md ... ok4063test mdtest::external/pytest.md ... ok4064test mdtest::external/strawberry.md ... ok4065test mdtest::directives/cast.md ... ok4066test mdtest::generics/builtins.md ... ok4067test mdtest::exception/control_flow.md ... ok4068test mdtest::expression/attribute.md ... ok4069test mdtest::expression/if.md ... ok4070test mdtest::expression/lambda.md ... ok4071test mdtest::expression/yield_and_yield_from.md ... ok4072test mdtest::exception/basic.md ... ok4073test mdtest::expression/len.md ... ok4074test mdtest::generics/legacy/callables.md ... ok4075test mdtest::function/parameters.md ... ok4076test mdtest::expression/boolean.md ... ok4077test mdtest::generics/pep695/aliases.md ... ok4078test mdtest::generics/legacy/variance.md ... ok4079test mdtest::generics/pep695/callables.md ... ok4080test mdtest::exhaustiveness_checking.md ... ok4081test mdtest::generics/legacy/functions.md ... ok4082test mdtest::generics/pep695/concatenate.md ... ok4083test mdtest::final.md ... ok4084test mdtest::function/return_type.md ... ok4085test mdtest::generics/pep695/classes.md ... ok4086test mdtest::generics/pep695/variables.md ... ok4087test mdtest::generics/pep695/paramspec.md ... ok4088test mdtest::generics/legacy/classes.md ... ok4089test mdtest::import/conflicts.md ... ok4090test mdtest::diagnostics/semantic_syntax_errors.md ... ok4091test mdtest::import/conditional.md ... ok4092test mdtest::import/allowed_unresolved_imports.md ... ok4093test mdtest::import/builtins.md ... ok4094test mdtest::generics/scoping.md ... ok4095test mdtest::generics/legacy/variables.md ... ok4096test mdtest::import/dunder_file_attribute.md ... ok4097test mdtest::import/cyclic.md ... ok4098test mdtest::import/basic.md ... ok4099test mdtest::import/case_sensitive.md ... ok4100test mdtest::import/invalid_syntax.md ... ok4101test mdtest::import/errors.md ... ok4102test mdtest::import/module_getattr.md ... ok4103test mdtest::import/conventions.md ... ok4104test mdtest::import/legacy_namespace.md ... ok4105test mdtest::generics/legacy/paramspec.md ... ok4106test mdtest::import/replace_imports_with_any.md ... ok4107test mdtest::import/partial_stub_packages.md ... ok4108test mdtest::import/namespace.md ... ok4109test mdtest::import/site_packages_discovery.md ... ok4110test mdtest::import/tracking.md ... ok4111test mdtest::import/stubs.md ... ok4112test mdtest::import/nonstandard_conventions.md ... ok4113test mdtest::import/relative.md ... ok4114test mdtest::generics/pep695/variance.md ... ok4115test mdtest::known_constants.md ... ok4116test mdtest::import/workspaces.md ... ok4117test mdtest::invalid_syntax.md ... ok4118test mdtest::instance_layout_conflict.md ... ok4119test mdtest::libraries/numpy.md ... ok4120test mdtest::literal/bytes.md ... ok4121test mdtest::literal/boolean.md ... ok4122test mdtest::import/dunder_all.md ... ok4123test mdtest::dataclasses/dataclasses.md ... ok4124test mdtest::literal/float.md ... ok4125test mdtest::literal/collections/tuple.md ... ok4126test mdtest::literal/complex.md ... ok4127test mdtest::import/stub_packages.md ... ok4128test mdtest::literal/collections/list.md ... ok4129test mdtest::literal/collections/set.md ... ok4130test mdtest::literal/f_string.md ... ok4131test mdtest::literal/string.md ... ok4132test mdtest::mdtest_custom_typeshed.md ... ok4133test mdtest::literal/ellipsis.md ... ok4134test mdtest::literal/integer.md ... ok4135test mdtest::loops/iterators.md ... ok4136test mdtest::literal/collections/dictionary.md ... ok4137test mdtest::narrow/assert.md ... ok4138test mdtest::implicit_type_aliases.md ... ok4139test mdtest::intersection_types.md ... ok4140test mdtest::literal/collections/generator_expressions.md ... ok4141test mdtest::narrow/aliased_conditions.md ... ok4142test mdtest::loops/while_loop.md ... ok4143test mdtest::loops/async_for.md ... ok4144test mdtest::narrow/bool-call.md ... ok4145test mdtest::narrow/boolean.md ... ok4146test mdtest::mdtest_config.md ... ok4147test mdtest::liskov.md ... ok4148test mdtest::narrow/callable.md ... ok4149test mdtest::narrow/assignment.md ... ok4150test mdtest::narrow/conditionals/elif_else.md ... ok4151test mdtest::narrow/conditionals/boolean.md ... ok4152test mdtest::mro.md ... ok4153test mdtest::narrow/hasattr.md ... ok4154test mdtest::narrow/conditionals/not.md ... ok4155test mdtest::narrow/conditionals/is_not.md ... ok4156test mdtest::ide_support/all_members.md ... ok4157test mdtest::narrow/conditionals/nested.md ... ok4158test mdtest::narrow/conditionals/is.md ... ok4159test mdtest::narrow/conditionals/eq.md ... ok4160test mdtest::narrow/post_if_statement.md ... ok4161test mdtest::narrow/conditionals/in.md ... ok4162test mdtest::narrow/complex_target.md ... ok4163test mdtest::narrow/truthiness.md ... ok4164test mdtest::narrow/len.md ... ok4165test mdtest::os_name.md ... ok4166test mdtest::narrow/while.md ... ok4167test mdtest::narrow/match.md ... ok4168test mdtest::metaclass.md ... ok4169test mdtest::named_tuple.md ... ok4170test mdtest::import/star.md ... ok4171test mdtest::paramspec_subcall_error_location.md ... ok4172test mdtest::override.md ... ok4173test mdtest::loops/for.md ... ok4174test mdtest::regression/1377_iteration_count_mismatch.md ... ok4175test mdtest::narrow/isinstance.md ... ok4176test mdtest::narrow/type_guards.md ... ok4177test mdtest::regression/14334_diagnostics_in_wrong_file.md ... ok4178test mdtest::public_types.md ... ok4179test mdtest::promotion.md ... ok4180test mdtest::regression/3020_callable_type_of.md ... ok4181test mdtest::regression/2799_constraint_correlation.md ... ok4182test mdtest::regression/2236_tuple_is_disjoint.md ... ok4183test mdtest::regression/3208_recursive_protocol_signature.md ... ok4184test mdtest::properties.md ... ok4185test mdtest::narrow/issubclass.md ... ok4186test mdtest::regression/paramspec_on_python39.md ... ok4187test mdtest::scopes/global-constants.md ... ok4188test mdtest::scopes/builtin.md ... ok4189test mdtest::regression/derived_constraint_cycles.md ... ok4190test mdtest::narrow/type.md ... ok4191test mdtest::scopes/annotate_global.md ... ok4192test mdtest::shadowing/function.md ... ok4193test mdtest::scopes/moduletype_attrs.md ... ok4194test mdtest::shadowing/variable_declaration.md ... ok4195test mdtest::scopes/unbound.md ... ok4196test mdtest::sentinels.md ... ok4197test mdtest::pep613_type_aliases.md ... ok4198test mdtest::scopes/nonlocal.md ... ok4199test mdtest::shadowing/class.md ... ok4200test mdtest::scopes/global.md ... ok4201test mdtest::stubs/locals.md ... ok4202test mdtest::subscript/alias.md ... ok4203test mdtest::scopes/eager.md ... ok4204test mdtest::pep695_type_aliases.md ... ok4205test mdtest::stubs/ellipsis.md ... ok4206test mdtest::stubs/class.md ... ok4207test mdtest::enums.md ... ok4208test mdtest::subscript/bytes.md ... ok4209test mdtest::subscript/class.md ... ok4210test mdtest::struct_unpack.md ... ok4211test mdtest::subscript/stepsize_zero.md ... ok4212test mdtest::overloads.md ... ok4213test mdtest::subscript/string.md ... ok4214test mdtest::subscript/lists.md ... ok4215test mdtest::python_version.md ... ok4216test mdtest::type_compendium/README.md ... ok4217test mdtest::subscript/instance.md ... ok4218test mdtest::subscript/assignment_diagnostics.md ... ok4219test mdtest::suppressions/no_type_check.md ... ok4220test mdtest::subscript/typevar.md ... ok4221test mdtest::scopes/class_implicit_attrs.md ... ok4222test mdtest::sys_platform.md ... ok4223test mdtest::suppressions/ty_ignore.md ... ok4224test mdtest::sys_version_info.md ... ok4225test mdtest::type_compendium/any.md ... ok4226test mdtest::t_strings.md ... ok4227test mdtest::type_compendium/always_truthy_falsy.md ... ok4228test mdtest::type_compendium/none.md ... ok4229test mdtest::type_compendium/not_t.md ... ok4230test mdtest::type_compendium/object.md ... ok4231test mdtest::type_compendium/never.md ... ok4232test mdtest::terminal_statements.md ... ok4233test mdtest::type_of/dynamic.md ... ok4234test mdtest::suppressions/type_ignore.md ... ok4235test mdtest::type_of/typing_dot_Type.md ... ok4236test mdtest::type_display/callable.md ... ok4237test mdtest::type_properties/constraints.md ... ok4238test mdtest::statically_known_branches.md ... ok4239test mdtest::type_properties/implies_subtype_of.md ... ok4240test mdtest::type_properties/is_single_valued.md ... ok4241test mdtest::type_properties/str_repr.md ... ok4242test mdtest::type_properties/satisfied_by_all_typevars.md ... ok4243test mdtest::type_of/generics.md ... ok4244test mdtest::type_compendium/integer_literals.md ... ok4245test mdtest::type_properties/tuples_containing_never.md ... ok4246test mdtest::type_properties/truthiness.md ... ok4247test mdtest::type_qualifiers/initvar.md ... ok4248test mdtest::type_properties/is_assignable_to.md ... ok4249test mdtest::subscript/tuple.md ... ok4250test mdtest::type_of/basic.md ... ok4251test mdtest::unary/custom.md ... ok4252test mdtest::type_compendium/tuple.md ... ok4253test mdtest::unary/integers.md ... ok4254test mdtest::ty_extensions.md ... ok4255test mdtest::type_properties/is_equivalent_to.md ... ok4256test mdtest::unary/invert_add_usub.md ... ok4257test mdtest::type_properties/is_singleton.md ... ok4258test mdtest::unary/not.md ... ok4259test mdtest::type_properties/is_subtype_of.md ... ok4260test mdtest::type_properties/materialization.md ... ok4261test mdtest::type_properties/is_disjoint_from.md ... ok4262test mdtest::type_qualifiers/classvar.md ... ok4263test mdtest::with/async.md ... ok4264test mdtest::union_types.md ... ok4265test mdtest::with/sync.md ... ok4266test mdtest::unreachable.md ... ok4267test mdtest::unpacking.md ... ok4268test mdtest::protocols.md ... ok4269test mdtest::type_qualifiers/final.md ... ok4270test mdtest::typed_dict.md ... ok42714272test result: ok. 335 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 9.40s42734274 Running unittests src/lib.rs (/build/source/target/aarch64-unknown-linux-gnu/release/deps/ty_test-d9a3ef18ac2f415d)42754276running 1 test4277test tests::multiple_sections_with_dependencies_not_allowed ... ok42784279test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s42804281 Doc-tests ty_python_semantic42824283running 2 tests4284test crates/ty_python_semantic/src/diagnostic/mod.rs - diagnostic::DiagnosticGuard::sink (line 178) ... ignored4285test crates/ty_python_semantic/src/lint.rs - lint::declare_lint (line 226) ... ok42864287test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s428842894290running 1 test4291test crates/ty_python_semantic/src/types/class/static_literal.rs - types::class::static_literal::StaticClassLiteral<'db>::header_range (line 2666) ... ignored42924293test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s42944295all doctests ran in 61.72s; merged doctests compilation took 61.70s4296/build/source4297Finished cargoCheckHook4298checkPhase completed in 20 minutes 35 seconds
installPhase
4299Executing cargoInstallHook4300Finished cargoInstallHook
fixupPhase
4301shrinking RPATHs of ELF executables and libraries in /nix/store/wh4pan7jbklr46bngk1qkkxmglaqbqc4-ty-0.0.384302shrinking /nix/store/wh4pan7jbklr46bngk1qkkxmglaqbqc4-ty-0.0.38/bin/ty4303checking for references to /build/ in /nix/store/wh4pan7jbklr46bngk1qkkxmglaqbqc4-ty-0.0.38...4304patching script interpreter paths in /nix/store/wh4pan7jbklr46bngk1qkkxmglaqbqc4-ty-0.0.384305stripping (with command strip and flags -S -p) in /nix/store/wh4pan7jbklr46bngk1qkkxmglaqbqc4-ty-0.0.38/bin
installCheckPhase
4306Executing versionCheckPhase4307Successfully managed to find version 0.0.38 in the output of the command /nix/store/wh4pan7jbklr46bngk1qkkxmglaqbqc4-ty-0.0.38/bin/ty --version4308ty 0.0.384309Finished versionCheckPhase4310no Makefile or custom installCheckPhase, doing nothing