From 39f105bc4ac71ec37372c7fc535ae034fafa23ed Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Mon, 3 Nov 2025 10:38:20 -0500 Subject: [PATCH] [ty] Use "cannot" consistently over "can not" (#21255) --- crates/ruff_formatter/src/format_element.rs | 2 +- crates/ruff_python_formatter/src/pattern/mod.rs | 2 +- .../resources/mdtest/annotations/any.md | 2 +- crates/ty_python_semantic/resources/mdtest/attributes.md | 8 ++++---- crates/ty_python_semantic/resources/mdtest/call/dunder.md | 2 +- .../resources/mdtest/call/getattr_static.md | 2 +- .../ty_python_semantic/resources/mdtest/call/methods.md | 2 +- .../resources/mdtest/dataclasses/dataclasses.md | 2 +- .../resources/mdtest/expression/yield_and_yield_from.md | 2 +- .../resources/mdtest/ide_support/all_members.md | 2 +- .../resources/mdtest/intersection_types.md | 2 +- .../ty_python_semantic/resources/mdtest/ty_extensions.md | 2 +- .../resources/mdtest/type_compendium/any.md | 4 ++-- .../resources/mdtest/type_compendium/integer_literals.md | 6 +++--- .../resources/mdtest/type_properties/is_disjoint_from.md | 2 +- crates/ty_python_semantic/resources/mdtest/typed_dict.md | 6 +++--- crates/ty_python_semantic/resources/mdtest/unreachable.md | 4 ++-- crates/ty_python_semantic/src/place.rs | 2 +- .../src/semantic_index/reachability_constraints.rs | 8 ++++---- crates/ty_python_semantic/src/subscript.rs | 2 +- crates/ty_python_semantic/src/types.rs | 6 +++--- crates/ty_python_semantic/src/types/diagnostic.rs | 2 +- crates/ty_python_semantic/src/types/generics.rs | 2 +- crates/ty_python_semantic/src/types/infer/builder.rs | 4 ++-- 24 files changed, 39 insertions(+), 39 deletions(-) diff --git a/crates/ruff_formatter/src/format_element.rs b/crates/ruff_formatter/src/format_element.rs index 529992c642..715eeb3cfd 100644 --- a/crates/ruff_formatter/src/format_element.rs +++ b/crates/ruff_formatter/src/format_element.rs @@ -487,7 +487,7 @@ pub trait FormatElements { /// Represents the width by adding 1 to the actual width so that the width can be represented by a [`NonZeroU32`], /// allowing [`TextWidth`] or [`Option`] fit in 4 bytes rather than 8. /// -/// This means that 2^32 can not be precisely represented and instead has the same value as 2^32-1. +/// This means that 2^32 cannot be precisely represented and instead has the same value as 2^32-1. /// This imprecision shouldn't matter in practice because either text are longer than any configured line width /// and thus, the text should break. #[derive(Copy, Clone, Debug, Eq, PartialEq)] diff --git a/crates/ruff_python_formatter/src/pattern/mod.rs b/crates/ruff_python_formatter/src/pattern/mod.rs index e255d59359..557337ddc5 100644 --- a/crates/ruff_python_formatter/src/pattern/mod.rs +++ b/crates/ruff_python_formatter/src/pattern/mod.rs @@ -299,7 +299,7 @@ impl<'a> CanOmitOptionalParenthesesVisitor<'a> { } // `case 4+3j:` or `case 4-3j: - // Can not contain arbitrary expressions. Limited to complex numbers. + // Cannot contain arbitrary expressions. Limited to complex numbers. Expr::BinOp(_) => { self.update_max_precedence(OperatorPrecedence::Additive, 1); } diff --git a/crates/ty_python_semantic/resources/mdtest/annotations/any.md b/crates/ty_python_semantic/resources/mdtest/annotations/any.md index d6baf8cbf9..c2cc2d2461 100644 --- a/crates/ty_python_semantic/resources/mdtest/annotations/any.md +++ b/crates/ty_python_semantic/resources/mdtest/annotations/any.md @@ -118,7 +118,7 @@ def takes_other_protocol(f: OtherProtocol): ... takes_other_protocol(SubclassOfAny()) ``` -A subclass of `Any` cannot be assigned to literal types, since those can not be subclassed: +A subclass of `Any` cannot be assigned to literal types, since those cannot be subclassed: ```py from typing import Any, Literal diff --git a/crates/ty_python_semantic/resources/mdtest/attributes.md b/crates/ty_python_semantic/resources/mdtest/attributes.md index 10b6d42318..b1dbd57c78 100644 --- a/crates/ty_python_semantic/resources/mdtest/attributes.md +++ b/crates/ty_python_semantic/resources/mdtest/attributes.md @@ -1878,7 +1878,7 @@ date.day = 8 date.month = 4 date.year = 2025 -# error: [unresolved-attribute] "Can not assign object of type `Literal["UTC"]` to attribute `tz` on type `Date` with custom `__setattr__` method." +# error: [unresolved-attribute] "Cannot assign object of type `Literal["UTC"]` to attribute `tz` on type `Date` with custom `__setattr__` method." date.tz = "UTC" ``` @@ -1894,10 +1894,10 @@ class Frozen: existing: int = 1 def __setattr__(self, name, value) -> Never: - raise AttributeError("Attributes can not be modified") + raise AttributeError("Attributes cannot be modified") instance = Frozen() -instance.non_existing = 2 # error: [invalid-assignment] "Can not assign to unresolved attribute `non_existing` on type `Frozen`" +instance.non_existing = 2 # error: [invalid-assignment] "Cannot assign to unresolved attribute `non_existing` on type `Frozen`" instance.existing = 2 # error: [invalid-assignment] "Cannot assign to attribute `existing` on type `Frozen` whose `__setattr__` method returns `Never`/`NoReturn`" ``` @@ -1949,7 +1949,7 @@ def flag() -> bool: class Frozen: if flag(): def __setattr__(self, name, value) -> Never: - raise AttributeError("Attributes can not be modified") + raise AttributeError("Attributes cannot be modified") instance = Frozen() instance.non_existing = 2 # error: [invalid-assignment] diff --git a/crates/ty_python_semantic/resources/mdtest/call/dunder.md b/crates/ty_python_semantic/resources/mdtest/call/dunder.md index 721517eac4..f7be30464c 100644 --- a/crates/ty_python_semantic/resources/mdtest/call/dunder.md +++ b/crates/ty_python_semantic/resources/mdtest/call/dunder.md @@ -194,7 +194,7 @@ class_with_descriptor_dunder = ClassWithDescriptorDunder() reveal_type(class_with_descriptor_dunder[0]) # revealed: str ``` -## Dunders can not be overwritten on instances +## Dunders cannot be overwritten on instances If we attempt to overwrite a dunder method on an instance, it does not affect the behavior of implicit dunder calls: diff --git a/crates/ty_python_semantic/resources/mdtest/call/getattr_static.md b/crates/ty_python_semantic/resources/mdtest/call/getattr_static.md index a8d87bbfa6..7841d04f79 100644 --- a/crates/ty_python_semantic/resources/mdtest/call/getattr_static.md +++ b/crates/ty_python_semantic/resources/mdtest/call/getattr_static.md @@ -84,7 +84,7 @@ class E(metaclass=Meta): ... reveal_type(inspect.getattr_static(E, "attr")) # revealed: int ``` -Metaclass attributes can not be added when probing an instance of the class: +Metaclass attributes cannot be added when probing an instance of the class: ```py reveal_type(inspect.getattr_static(E(), "attr", "non_existent")) # revealed: Literal["non_existent"] diff --git a/crates/ty_python_semantic/resources/mdtest/call/methods.md b/crates/ty_python_semantic/resources/mdtest/call/methods.md index f101aa6e64..07740c2f89 100644 --- a/crates/ty_python_semantic/resources/mdtest/call/methods.md +++ b/crates/ty_python_semantic/resources/mdtest/call/methods.md @@ -308,7 +308,7 @@ reveal_type(C.f) # revealed: bound method .f(arg: int) -> str reveal_type(C.f(1)) # revealed: str ``` -The method `f` can not be accessed from an instance of the class: +The method `f` cannot be accessed from an instance of the class: ```py # error: [unresolved-attribute] "Object of type `C` has no attribute `f`" diff --git a/crates/ty_python_semantic/resources/mdtest/dataclasses/dataclasses.md b/crates/ty_python_semantic/resources/mdtest/dataclasses/dataclasses.md index d8619851a2..8548085302 100644 --- a/crates/ty_python_semantic/resources/mdtest/dataclasses/dataclasses.md +++ b/crates/ty_python_semantic/resources/mdtest/dataclasses/dataclasses.md @@ -424,7 +424,7 @@ from dataclasses import dataclass class MyFrozenClass: ... frozen = MyFrozenClass() -frozen.x = 2 # error: [invalid-assignment] "Can not assign to unresolved attribute `x` on type `MyFrozenClass`" +frozen.x = 2 # error: [invalid-assignment] "Cannot assign to unresolved attribute `x` on type `MyFrozenClass`" ``` A diagnostic is also emitted if a frozen dataclass is inherited, and an attempt is made to mutate an diff --git a/crates/ty_python_semantic/resources/mdtest/expression/yield_and_yield_from.md b/crates/ty_python_semantic/resources/mdtest/expression/yield_and_yield_from.md index 629fd2b554..a207b3414f 100644 --- a/crates/ty_python_semantic/resources/mdtest/expression/yield_and_yield_from.md +++ b/crates/ty_python_semantic/resources/mdtest/expression/yield_and_yield_from.md @@ -26,7 +26,7 @@ def outer_generator(): ## `yield from` with a custom iterable `yield from` can also be used with custom iterable types. In that case, the type of the `yield from` -expression can not be determined +expression cannot be determined ```py from typing import Generator, TypeVar, Generic diff --git a/crates/ty_python_semantic/resources/mdtest/ide_support/all_members.md b/crates/ty_python_semantic/resources/mdtest/ide_support/all_members.md index 03ea95b4a2..e8c19625ca 100644 --- a/crates/ty_python_semantic/resources/mdtest/ide_support/all_members.md +++ b/crates/ty_python_semantic/resources/mdtest/ide_support/all_members.md @@ -130,7 +130,7 @@ static_assert(has_member(C, "base_attr")) static_assert(not has_member(C, "non_existent")) ``` -But instance attributes can not be accessed this way: +But instance attributes cannot be accessed this way: ```py static_assert(not has_member(C, "instance_attr")) diff --git a/crates/ty_python_semantic/resources/mdtest/intersection_types.md b/crates/ty_python_semantic/resources/mdtest/intersection_types.md index 0f5b37eb88..022e09c43b 100644 --- a/crates/ty_python_semantic/resources/mdtest/intersection_types.md +++ b/crates/ty_python_semantic/resources/mdtest/intersection_types.md @@ -444,7 +444,7 @@ def _( reveal_type(i07) # revealed: Never reveal_type(i08) # revealed: Never -# `bool` is final and can not be subclassed, so `type[bool]` is equivalent to `Literal[bool]`, which +# `bool` is final and cannot be subclassed, so `type[bool]` is equivalent to `Literal[bool]`, which # is disjoint from `type[str]`: def example_type_bool_type_str( i: Intersection[type[bool], type[str]], diff --git a/crates/ty_python_semantic/resources/mdtest/ty_extensions.md b/crates/ty_python_semantic/resources/mdtest/ty_extensions.md index 22d92b54af..4ff580954e 100644 --- a/crates/ty_python_semantic/resources/mdtest/ty_extensions.md +++ b/crates/ty_python_semantic/resources/mdtest/ty_extensions.md @@ -390,7 +390,7 @@ static_assert(not is_single_valued(Literal["a"] | Literal["b"])) We use `TypeOf` to get the inferred type of an expression. This is useful when we want to refer to it in a type expression. For example, if we want to make sure that the class literal type `str` is a -subtype of `type[str]`, we can not use `is_subtype_of(str, type[str])`, as that would test if the +subtype of `type[str]`, we cannot use `is_subtype_of(str, type[str])`, as that would test if the type `str` itself is a subtype of `type[str]`. Instead, we can use `TypeOf[str]` to get the type of the expression `str`: diff --git a/crates/ty_python_semantic/resources/mdtest/type_compendium/any.md b/crates/ty_python_semantic/resources/mdtest/type_compendium/any.md index a0de2576b9..255e744af9 100644 --- a/crates/ty_python_semantic/resources/mdtest/type_compendium/any.md +++ b/crates/ty_python_semantic/resources/mdtest/type_compendium/any.md @@ -54,7 +54,7 @@ class Small(Medium): ... static_assert(is_assignable_to(Any | Medium, Big)) static_assert(is_assignable_to(Any | Medium, Medium)) -# `Any | Medium` is at least as large as `Medium`, so we can not assign it to `Small`: +# `Any | Medium` is at least as large as `Medium`, so we cannot assign it to `Small`: static_assert(not is_assignable_to(Any | Medium, Small)) ``` @@ -84,7 +84,7 @@ static_assert(is_assignable_to(Small, Intersection[Any, Medium])) static_assert(is_assignable_to(Medium, Intersection[Any, Medium])) ``` -`Any & Medium` is no larger than `Medium`, so we can not assign `Big` to it. There is no possible +`Any & Medium` is no larger than `Medium`, so we cannot assign `Big` to it. There is no possible materialization of `Any & Medium` that would make it as big as `Big`: ```py diff --git a/crates/ty_python_semantic/resources/mdtest/type_compendium/integer_literals.md b/crates/ty_python_semantic/resources/mdtest/type_compendium/integer_literals.md index d8d42ae7ad..66b759b9ac 100644 --- a/crates/ty_python_semantic/resources/mdtest/type_compendium/integer_literals.md +++ b/crates/ty_python_semantic/resources/mdtest/type_compendium/integer_literals.md @@ -32,8 +32,8 @@ static_assert(not is_singleton(Literal[1])) static_assert(not is_singleton(Literal[54165])) ``` -This has implications for type-narrowing. For example, you can not use the `is not` operator to -check whether a variable has a specific integer literal type, but this is not a recommended practice +This has implications for type-narrowing. For example, you cannot use the `is not` operator to check +whether a variable has a specific integer literal type, but this is not a recommended practice anyway. ```py @@ -44,7 +44,7 @@ def f(x: int): reveal_type(x) # revealed: Literal[54165] if x is not 54165: - # But here, we can not narrow the type (to `int & ~Literal[54165]`), because `x` might also + # But here, we cannot narrow the type (to `int & ~Literal[54165]`), because `x` might also # have the value `54165`, but a different object identity. reveal_type(x) # revealed: int ``` diff --git a/crates/ty_python_semantic/resources/mdtest/type_properties/is_disjoint_from.md b/crates/ty_python_semantic/resources/mdtest/type_properties/is_disjoint_from.md index dfad076726..db4b0f5f98 100644 --- a/crates/ty_python_semantic/resources/mdtest/type_properties/is_disjoint_from.md +++ b/crates/ty_python_semantic/resources/mdtest/type_properties/is_disjoint_from.md @@ -45,7 +45,7 @@ class C(B1, B2): ... # ... which lies in their intersection: static_assert(is_subtype_of(C, Intersection[B1, B2])) -# However, if a class is marked final, it can not be subclassed ... +# However, if a class is marked final, it cannot be subclassed ... @final class FinalSubclass(A): ... diff --git a/crates/ty_python_semantic/resources/mdtest/typed_dict.md b/crates/ty_python_semantic/resources/mdtest/typed_dict.md index 14142020a2..30bbb2132b 100644 --- a/crates/ty_python_semantic/resources/mdtest/typed_dict.md +++ b/crates/ty_python_semantic/resources/mdtest/typed_dict.md @@ -680,7 +680,7 @@ def _(p: Person) -> None: reveal_type(p.__class__) # revealed: ``` -Also, the "attributes" on the class definition can not be accessed. Neither on the class itself, nor +Also, the "attributes" on the class definition cannot be accessed. Neither on the class itself, nor on inhabitants of the type defined by the class: ```py @@ -714,7 +714,7 @@ reveal_type(Person.__required_keys__) # revealed: frozenset[str] reveal_type(Person.__optional_keys__) # revealed: frozenset[str] ``` -These attributes can not be accessed on inhabitants: +These attributes cannot be accessed on inhabitants: ```py def _(person: Person) -> None: @@ -723,7 +723,7 @@ def _(person: Person) -> None: person.__optional_keys__ # error: [unresolved-attribute] ``` -Also, they can not be accessed on `type(person)`, as that would be `dict` at runtime: +Also, they cannot be accessed on `type(person)`, as that would be `dict` at runtime: ```py def _(person: Person) -> None: diff --git a/crates/ty_python_semantic/resources/mdtest/unreachable.md b/crates/ty_python_semantic/resources/mdtest/unreachable.md index 7321ed9b01..73e174f6a1 100644 --- a/crates/ty_python_semantic/resources/mdtest/unreachable.md +++ b/crates/ty_python_semantic/resources/mdtest/unreachable.md @@ -187,8 +187,8 @@ python-platform = "all" If `python-platform` is set to `all`, we treat the platform as unspecified. This means that we do not infer a literal type like `Literal["win32"]` for `sys.platform`, but instead fall back to -`LiteralString` (the `typeshed` annotation for `sys.platform`). This means that we can not -statically determine the truthiness of a branch like `sys.platform == "win32"`. +`LiteralString` (the `typeshed` annotation for `sys.platform`). This means that we cannot statically +determine the truthiness of a branch like `sys.platform == "win32"`. See for a plan on how this could be improved. diff --git a/crates/ty_python_semantic/src/place.rs b/crates/ty_python_semantic/src/place.rs index 3989942b04..c0b3428345 100644 --- a/crates/ty_python_semantic/src/place.rs +++ b/crates/ty_python_semantic/src/place.rs @@ -733,7 +733,7 @@ pub(crate) fn place_by_id<'db>( }; // If a symbol is undeclared, but qualified with `typing.Final`, we use the right-hand side - // inferred type, without unioning with `Unknown`, because it can not be modified. + // inferred type, without unioning with `Unknown`, because it cannot be modified. if let Some(qualifiers) = declared.is_bare_final() { let bindings = all_considered_bindings(); return place_from_bindings_impl(db, bindings, requires_explicit_reexport) diff --git a/crates/ty_python_semantic/src/semantic_index/reachability_constraints.rs b/crates/ty_python_semantic/src/semantic_index/reachability_constraints.rs index 1224190209..9e6d60668f 100644 --- a/crates/ty_python_semantic/src/semantic_index/reachability_constraints.rs +++ b/crates/ty_python_semantic/src/semantic_index/reachability_constraints.rs @@ -13,7 +13,7 @@ //! of `test`. When evaluating a constraint, there are three possible outcomes: always true, always //! false, or ambiguous. For a simple constraint like this, always-true and always-false correspond //! to the case in which we can infer that the type of `test` is `Literal[True]` or `Literal[False]`. -//! In any other case, like if the type of `test` is `bool` or `Unknown`, we can not statically +//! In any other case, like if the type of `test` is `bool` or `Unknown`, we cannot statically //! determine whether `test` is truthy or falsy, so the outcome would be "ambiguous". //! //! @@ -29,7 +29,7 @@ //! Here, we would accumulate a reachability constraint of `test1 AND test2`. We can statically //! determine that this position is *always* reachable only if both `test1` and `test2` are //! always true. On the other hand, we can statically determine that this position is *never* -//! reachable if *either* `test1` or `test2` is always false. In any other case, we can not +//! reachable if *either* `test1` or `test2` is always false. In any other case, we cannot //! determine whether this position is reachable or not, so the outcome is "ambiguous". This //! corresponds to a ternary *AND* operation in [Kleene] logic: //! @@ -60,7 +60,7 @@ //! The third branch ends in a terminal statement [^1]. When we merge control flow, we need to consider //! the reachability through either the first or the second branch. The current position is only //! *definitely* unreachable if both `test1` and `test2` are always false. It is definitely -//! reachable if *either* `test1` or `test2` is always true. In any other case, we can not statically +//! reachable if *either* `test1` or `test2` is always true. In any other case, we cannot statically //! determine whether it is reachable or not. This operation corresponds to a ternary *OR* operation: //! //! ```text @@ -91,7 +91,7 @@ //! ## Explicit ambiguity //! //! In some cases, we explicitly record an “ambiguous” constraint. We do this when branching on -//! something that we can not (or intentionally do not want to) analyze statically. `for` loops are +//! something that we cannot (or intentionally do not want to) analyze statically. `for` loops are //! one example: //! ```py //! def _(): diff --git a/crates/ty_python_semantic/src/subscript.rs b/crates/ty_python_semantic/src/subscript.rs index b7ea13db10..b51a9e597b 100644 --- a/crates/ty_python_semantic/src/subscript.rs +++ b/crates/ty_python_semantic/src/subscript.rs @@ -27,7 +27,7 @@ fn from_negative_i32(index: i32) -> usize { static_assertions::const_assert!(usize::BITS >= 32); index.checked_neg().map(from_nonnegative_i32).unwrap_or({ - // 'checked_neg' only fails for i32::MIN. We can not + // 'checked_neg' only fails for i32::MIN. We cannot // represent -i32::MIN as a i32, but we can represent // it as a usize, since usize is at least 32 bits. from_nonnegative_i32(i32::MAX) + 1 diff --git a/crates/ty_python_semantic/src/types.rs b/crates/ty_python_semantic/src/types.rs index b20f332999..ffe0f3066b 100644 --- a/crates/ty_python_semantic/src/types.rs +++ b/crates/ty_python_semantic/src/types.rs @@ -297,7 +297,7 @@ impl AttributeKind { /// When invoked on a class object, the fallback type (a class attribute) can shadow a /// non-data descriptor of the meta-type (the class's metaclass). However, this is not /// true for instances. When invoked on an instance, the fallback type (an attribute on -/// the instance) can not completely shadow a non-data descriptor of the meta-type (the +/// the instance) cannot completely shadow a non-data descriptor of the meta-type (the /// class), because we do not currently attempt to statically infer if an instance /// attribute is definitely defined (i.e. to check whether a particular method has been /// called). @@ -4412,7 +4412,7 @@ impl<'db> Type<'db> { }; if result.is_class_var() && self.is_typed_dict() { - // `ClassVar`s on `TypedDictFallback` can not be accessed on inhabitants of `SomeTypedDict`. + // `ClassVar`s on `TypedDictFallback` cannot be accessed on inhabitants of `SomeTypedDict`. // They can only be accessed on `SomeTypedDict` directly. return Place::Undefined.into(); } @@ -12050,7 +12050,7 @@ pub(crate) mod tests { assert!(todo1.is_assignable_to(&db, int)); // We lose information when combining several `Todo` types. This is an - // acknowledged limitation of the current implementation. We can not + // acknowledged limitation of the current implementation. We cannot // easily store the meta information of several `Todo`s in a single // variant, as `TodoType` needs to implement `Copy`, meaning it can't // contain `Vec`/`Box`/etc., and can't be boxed itself. diff --git a/crates/ty_python_semantic/src/types/diagnostic.rs b/crates/ty_python_semantic/src/types/diagnostic.rs index 2dd75e57aa..6ab6f2a447 100644 --- a/crates/ty_python_semantic/src/types/diagnostic.rs +++ b/crates/ty_python_semantic/src/types/diagnostic.rs @@ -2000,7 +2000,7 @@ pub(super) fn report_slice_step_size_zero(context: &InferContext, node: AnyNodeR let Some(builder) = context.report_lint(&ZERO_STEPSIZE_IN_SLICE, node) else { return; }; - builder.into_diagnostic("Slice step size can not be zero"); + builder.into_diagnostic("Slice step size cannot be zero"); } fn report_invalid_assignment_with_message( diff --git a/crates/ty_python_semantic/src/types/generics.rs b/crates/ty_python_semantic/src/types/generics.rs index 98f7cb736f..444c5badd6 100644 --- a/crates/ty_python_semantic/src/types/generics.rs +++ b/crates/ty_python_semantic/src/types/generics.rs @@ -714,7 +714,7 @@ fn is_subtype_in_invariant_position<'db>( // TODO: // This should be removed and properly handled in the respective // `(Type::TypeVar(_), _) | (_, Type::TypeVar(_))` branch of - // `Type::has_relation_to_impl`. Right now, we can not generally + // `Type::has_relation_to_impl`. Right now, we cannot generally // return `ConstraintSet::from(true)` from that branch, as that // leads to union simplification, which means that we lose track // of type variables without recording the constraints under which diff --git a/crates/ty_python_semantic/src/types/infer/builder.rs b/crates/ty_python_semantic/src/types/infer/builder.rs index b74ff75404..078d49fe5e 100644 --- a/crates/ty_python_semantic/src/types/infer/builder.rs +++ b/crates/ty_python_semantic/src/types/infer/builder.rs @@ -3804,7 +3804,7 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> { let msg = if !member_exists { format!( - "Can not assign to unresolved attribute `{attribute}` on type `{}`", + "Cannot assign to unresolved attribute `{attribute}` on type `{}`", object_ty.display(db) ) } else if is_setattr_synthesized { @@ -3840,7 +3840,7 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> { self.context.report_lint(&UNRESOLVED_ATTRIBUTE, target) { builder.into_diagnostic(format_args!( - "Can not assign object of type `{}` to attribute \ + "Cannot assign object of type `{}` to attribute \ `{attribute}` on type `{}` with \ custom `__setattr__` method.", value_ty.display(db),