KotlinIsland

Results 501 comments of KotlinIsland

@JukkaL Thanks for the response! > The Kotlin example seems quite different I disagree, the Kotlin example is contrived to achieve the exact same semantic meaning as the Python code....

@hmc-cs-mdrissi `Final list` is still mutable and invariant. Perhaps you would want a protocol that matches `list` but without the mutation bits?

Not exactly what you want though, because you could still send a non-`list` and get a fail. Ideally you want an `ImmutableList` which would be covariant but still nominal.

This is what use site variance modifiers(`in`/`out`) are useful for in Kotlin: ```kt fun foo(someList: MutableList) { someList.clear() // valid someList.add(1.1) // Type mismatch: Inferred type is 'Float' but 'Nothing'...

In Kotlin the root type `Any` is split from `null`, and the union of those is denoted `Any?` In TypeScript the root type `unknown` includes `null` and `undefined`, but those...

@erictraut In my opinion this is identical to generic `TypeAlias`es: ```py L: TypeAlias = list[T] a: L[int] ``` Here `T` is unbound, yet it's a valid and semantically sound expression....

@AlexWaygood Could you transfer the issue to python/typing?

@erictraut basedmypy also uses a union.

> Container mutators That sounds incredibly unsafe, eg: ```py def foo(the_list: list[str]): the_list[0].upper() # SUS ALERT l1 = [] l2 = l1 l2.append(1) l1.append("AMONGUS") foo(l1) # is l1 a list[str]...

I'm not sure about the best approach for the version of the git hook, I would think matching the version of ktlint would be a bad idea as it would...