KotlinIsland

Results 497 comments of KotlinIsland

I'll ask mypy-play and see what they say.

@AlexWaygood It is true that the `ParamSpec` is only used once, but there is still an issue that the `P` could represent any signature. Look at this [playground](https://mypy-play.net/?mypy=master&python=3.11&flags=show-error-context%2Cshow-column-numbers%2Cshow-error-codes%2Cstrict%2Ccheck-untyped-defs%2Cdisallow-any-decorated%2Cdisallow-any-expr%2Cdisallow-any-explicit%2Cdisallow-any-generics%2Cdisallow-any-unimported%2Cdisallow-incomplete-defs%2Cdisallow-subclassing-any%2Cdisallow-untyped-calls%2Cdisallow-untyped-decorators%2Cdisallow-untyped-defs%2Cno-implicit-optional%2Cno-implicit-reexport%2Cno-strict-optional%2Cstrict-equality%2Cwarn-incomplete-stub%2Cwarn-redundant-casts%2Cwarn-return-any%2Cwarn-unreachable%2Cwarn-unused-configs%2Cwarn-unused-ignores&gist=925e84f802413a564c50857d35e1f525)

> IMHO, this sounds more like a linter feature than a type-checker feature 🤷🏻 > warn imo mypy is a practical tool, it should have linter style inspections

> so no basedruff then? when redknot drops maybe

In this scenario mypy pretty much assumes everything is immutable and only takes into consideration explicit mutation, not side effects from any function calls. This is because otherwise most narrowing...

Kotlin handles this correctly by only narrowing `val` properties, and leaving `var` properties un-narrowed. Kotlin also narrows on so called 'scope functions'(the last part of this example) ```kt class Foo(...