[red-knot] Rename *_ty functions #15617
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
General rules:
_ty
suffix of all functions to_type
._type_and_qualifiers
suffixes seem too long, so we ignore the existence of qualifiers and still speak of "types"_type
suffix if they return eitherType
,Option<Type>
, orTypeAndQualifiers
Free functions:
binding_ty
=>binding_type
declaration_ty
=>declaration_type
definition_expression_ty
=>definition_expression_type
Methods:
CallDunderResult::return_ty
=>return_type
NotCallableError::return_ty
=>return_type
NotCallableError::called_ty
=>called_type
TypeAndQualifiers::inner_ty
=>inner_type
TypeAliasType::value_ty
=>value_type
TypeInference::expression_ty
=>expression_type
TypeInference::try_expression_ty
=>try_expression_type
TypeInference::binding_ty
=>binding_type
TypeInference::declaration_ty
=>declaration_type
TypeInferenceBuilder::expression_ty
=>expression_type
TypeInferenceBuilder::file_expression_ty
=>file_expression_type
TypeInferenceBuilder::module_ty_from_name
=>module_type_from_name
ClassBase::try_from_ty
=>try_from_type
Parameter::annotated_ty
=>annotated_type
Parameter::default_ty
=>default_type
CallOutcome::return_ty
=>return_type
CallOutcome::return_ty_result
=>return_type_result
CallBinding::from_return_ty
=>from_return_type
CallBinding::set_return_ty
=>set_return_type
CallBinding::return_ty
=>return_type
CallBinding::parameter_tys
=>parameter_types
CallBinding::one_parameter_ty
=>one_parameter_type
CallBinding::two_parameter_tys
=>two_parameter_types
Unpacker::tuple_ty_elements
=>tuple_type_elements
StringPartsCollector::ty
=>string_type
Traits
HasTy
=>HasType
HasTy::ty
=>inferred_type
Test functions:
assert_public_ty
=>assert_public_type
assert_scope_ty
=>assert_scope_type
closes #15569
Test Plan
—