If you like flexibility with a good type system, give Typescript a try, its miles ahead of mypy and its designed by same person who’s behind C#.
5 in [5] == false
I want the type system to be predictable, so it can support whatever I want to build on top of.
There are features I'm missing with C#, but still I'll choose it over TS any day.
And that's why I keep [language X], because sometimes the equivalent in [language Z] is not as good.
For example, you can't do:
if isinstance(x, list[int])
though it would be super useful
els: List[int]
To test it at runtime you can use typeguard s @typechecked annotation. For convenience you can also use Pydantic.How do you do this in Pydantic though?
It can also be used to generate openapi swagger files from the types and things like that.
If you want to avoid this (and still want to use .NET) you'll have to make sure that the environment variable DOTNET_CLI_TELEMETRY_OPTOUT is set in all contexts before touching anything.
I didn't know about this. I wonder how that sits legally with local data protection rules (EU).
For what it's worth, the tool prints a clear warning the first time you invoke it. You shouldn't need to opt out regardless, but they do at least communicate their stalking.
The involvement of Guido in mypy is such a tragedy.
It was better, but it _feels_ like lipstick on a pig. I love Python, but types are not what it's best at. It's missing features that makes typing easier.
I've realized if was going to write typed Python, I might as well switch to one that has better support for that and switched to .NET.
I can do almost all the dynamics things that I can do in Python with C#, but in a type safe way. Expressions and extension methods, reflection with `nameOf` opens up a lot of possibilities.
One thing that kept me using Python was SqlAlchemy, an ORM, a damn good one. Entity Framework Core, after V6 is a better one, especially with LINQ.
If you have the opportunity, give it a try. You might be surprised.