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.
@Carberra2 ай бұрын
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!
@Heavy_Lvy2 ай бұрын
@@Carberra i hate the old syntax😭😭
@Heavy_Lvy2 ай бұрын
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.
@Carberra2 ай бұрын
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.
@Heavy_Lvy2 ай бұрын
@@Carberra hmm thats strange then, it was working fine for me just not default TypeVars with 3.13 syntax.🤷♂🤷♂🤷♂🤷♂
@EngineerNick2 ай бұрын
Thankyou this was a great summary and demo :)
@fmitchell238a2 ай бұрын
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).
@Carberra2 ай бұрын
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.
@marckiezeender2 ай бұрын
Protocols are basically just interfaces but without explicitly implementing them.
@jimhrelb21352 ай бұрын
I use Protocols to enforce kwargs types, so not just using Callable to enforce vargs
@murphygreen84842 ай бұрын
What's the benefits of ReadOnly over Final?
@Carberra2 ай бұрын
Can you use Final in TypedDicts? If so, I'm honestly not sure!
@murphygreen84842 ай бұрын
@@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
@Carberra2 ай бұрын
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.
@chrism68802 ай бұрын
Is it possible to back port the new repl to use it with older python versions?
@Carberra2 ай бұрын
Not to my knowledge. You can use the third-party IPython REPL in older versions though, which is different but very nice to use.
@solojazz752 ай бұрын
wait I thought that python 3.13 was about using 'type' as a keyword instead of TypeVar
@Carberra2 ай бұрын
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).
@solojazz752 ай бұрын
@@Carberra yeah i was with the idea it's the preferred way over TypeVar now. type T = ContextType