KotlinIsland
KotlinIsland
Yeah, I've always thought the `until` attribute wasn't optimal. Perhaps the template could be updated to reflect some of your practices.
> Could you clarify what benefits this enhancement would have? What new functionality would it bring over using, for example, unions? I don't really know what you mean, overloads provide...
You are correct that your example is an invalid use case for overloads, see the OP for a semi realistic use case.
Okay, here are some examples pulled from a private codebase: ```py @overload def open_browser( url: str, browser_name: Literal["firefox"], *, firefox_user_prefs: dict[str, float | str | bool] | None = ...,...
FYI Kotlin is now the default for Gradle build files. https://blog.gradle.org/kotlin-dsl-is-now-the-default-for-new-gradle-builds
> If you hate explicit Any for whatever reason ```py T = TypeVar("T") class Foo(Generic[T]): a: T def foo(f: Foo[Any]): f.a = "AMONGUS😳" f = Foo[int]() foo(f) ```
This was closed? Oh well, I'm still thinking of implementing this in basedmypy.
Tracking it here: https://github.com/KotlinIsland/basedmypy/issues/30. Not on any radar at the moment though.
@arvidfm the issue is that `_` is just an ordinary name, and would both need to be initialized beforehand, and somehow understood by the type machinery. Additionally, `_` is often...
Strangely, it correctly reports the error when the `TypeAlias` is ommitted. ```py from typing import TypeVar, TypeAlias T = TypeVar("T") TAlias = T # error: Type variable "__main__.T" is invalid...