Why do you use the old generics syntax for these examples? IMO, it doesn't much sense to use the old syntax when the new one is available. I understand using it for more general videos, so they apply to a wider public, but not here. Regardless, I'd appreciate it if you could show both versions anyway. Anyway, great video. Hopefully pyright implements the new typing stuff soon.
Largely because the PEP uses the old syntax, and neither Mypy or Pyright was particularly happy using the new syntax with defaults, so I decided to go with what's definitely known to work rather than complicate it. Glad you enjoyed the video though!
7:16 probably the extension is using a older version of pyright or mypy. The extension won't use the pyright/mypy version installed on your environment.
I was using the latest version of Pyright (at time of recording) from the terminal, not an extension. If Pyright doesn't support something, it's pretty much a dead cert Mypy doesn't support it either.
Thanks for this. I'm just now catching up on 3.13's features. A video on support for Protocols would be appreciated. My statically typed brain still can't quite fit itself around Python's protocols using duck typing, and compile-time or run-time predicates verifying that a class conforms to a Protocol would make using Protocols feel like black magic (or pure superstition).
Glad you enjoyed it! Protocols is actually a topic I've been meaning to cover for a while, so I'll bump that up the queue! The runtime checkable thing is a pretty nice feature, so I'll make sure to cover that as well.
@@Carberra oh I'm not sure, it's part of the typing library though! Speaking of typing things - why is typing a openpyxl object such a nightmare? I can't get PyCharm to recognize it
I believe Openpyxl isn't typed. If it has a stubs package, might be a case of installing that and getting PyCharm to recognise it? Though this isn't the first time I've heard about someone having trouble _this week_, so idk if something's going on.
3.12 introduced the type keyword as an alternative to TypeAlias. It also introduced an alternative syntax for TypeVars (though I haven't used that here as it's not fully supported by type checkers).
Nice, one step closer to pi-thon
Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan Shikanokonoko koshitantan
Thankyou this was a great summary and demo :)
Why do you use the old generics syntax for these examples? IMO, it doesn't much sense to use the old syntax when the new one is available. I understand using it for more general videos, so they apply to a wider public, but not here. Regardless, I'd appreciate it if you could show both versions anyway.
Anyway, great video. Hopefully pyright implements the new typing stuff soon.
Largely because the PEP uses the old syntax, and neither Mypy or Pyright was particularly happy using the new syntax with defaults, so I decided to go with what's definitely known to work rather than complicate it. Glad you enjoyed the video though!
@@Carberra i hate the old syntax😭😭
7:16 probably the extension is using a older version of pyright or mypy. The extension won't use the pyright/mypy version installed on your environment.
I was using the latest version of Pyright (at time of recording) from the terminal, not an extension. If Pyright doesn't support something, it's pretty much a dead cert Mypy doesn't support it either.
@@Carberra hmm thats strange then, it was working fine for me just not default TypeVars with 3.13 syntax.🤷♂🤷♂🤷♂🤷♂
Thanks for this. I'm just now catching up on 3.13's features.
A video on support for Protocols would be appreciated. My statically typed brain still can't quite fit itself around Python's protocols using duck typing, and compile-time or run-time predicates verifying that a class conforms to a Protocol would make using Protocols feel like black magic (or pure superstition).
Glad you enjoyed it! Protocols is actually a topic I've been meaning to cover for a while, so I'll bump that up the queue! The runtime checkable thing is a pretty nice feature, so I'll make sure to cover that as well.
Protocols are basically just interfaces but without explicitly implementing them.
I use Protocols to enforce kwargs types, so not just using Callable to enforce vargs
What's the benefits of ReadOnly over Final?
Can you use Final in TypedDicts? If so, I'm honestly not sure!
@@Carberra oh I'm not sure, it's part of the typing library though!
Speaking of typing things - why is typing a openpyxl object such a nightmare? I can't get PyCharm to recognize it
I believe Openpyxl isn't typed. If it has a stubs package, might be a case of installing that and getting PyCharm to recognise it? Though this isn't the first time I've heard about someone having trouble _this week_, so idk if something's going on.
Is it possible to back port the new repl to use it with older python versions?
Not to my knowledge. You can use the third-party IPython REPL in older versions though, which is different but very nice to use.
wait I thought that python 3.13 was about using 'type' as a keyword instead of TypeVar
3.12 introduced the type keyword as an alternative to TypeAlias. It also introduced an alternative syntax for TypeVars (though I haven't used that here as it's not fully supported by type checkers).
@@Carberra yeah i was with the idea it's the preferred way over TypeVar now.
type T = ContextType
it seems a bit more pythonic that TypeVar