Python Typing Generics and Python 3.11 Variadic Generics

Поділитися
Вставка
  • Опубліковано 2 лис 2024

КОМЕНТАРІ • 42

  • @paschalokafor9043
    @paschalokafor9043 Рік тому +6

    I recommend this video for any who wants to learn generic types in any language. For months I have struggled to grasp the concept. But now its really clear. Thank you.

  • @kazsm9666
    @kazsm9666 Рік тому +6

    This is a truly valuable explanation of generics, one of the best i've seen. Thank you for that!

  • @beckyamsel2997
    @beckyamsel2997 Рік тому +3

    Incredibly helpful explanation!! Can't thank you enough! The way you highlight the problem and then show how to solve it leaves no question of "when would I use this?" in the way my lecture at uni did.

  • @JayJay-ki4mi
    @JayJay-ki4mi Рік тому +7

    For anybody wondering the theme is called Noctis.

  • @paulweveritt
    @paulweveritt 2 роки тому +7

    Loved this video. Watched it carefully. Might set a reminder to watch it again in a month.
    All stuff I need to know but didn't. Perfect presentation style. Lots of Python typing stuff seems aimed at people coming from Java or C#. Thanks a bunch, Anthony.

    • @donfeto7636
      @donfeto7636 Рік тому

      i love it cuz he remind me of c# and how organized it was python is so messy :D

  • @YashDesai95
    @YashDesai95 3 місяці тому

    You might be Excommunicado for using light themes. but your contribution to society will never be forget. keep posting such awesome content. Yeah

  • @DevendraSingh-bk7sv
    @DevendraSingh-bk7sv Рік тому +4

    Great video sir..... I understood the concepts of Generics very well...

  • @hasnainkhattak6002
    @hasnainkhattak6002 Рік тому +1

    great video bro ......first video which really gives me a good understanding of python generics

  • @vaha2833
    @vaha2833 Рік тому +1

    I may need to check my doctor after this video >_>

  • @DarylStark
    @DarylStark 9 місяців тому

    This was a life saver! So clear and so helpful!

  • @mj2068
    @mj2068 9 місяців тому

    very very well explained, thanks Anthony, i totally get it now.

  • @AbnerAlvarado
    @AbnerAlvarado 7 місяців тому

    More videos! Do you know about processing and threading? Drop a video about it! 🙌🏼

  • @alemswazzu
    @alemswazzu 5 місяців тому +1

    Why did you annotate the types in the class twice?

  • @louidominicnaquita7723
    @louidominicnaquita7723 10 місяців тому

    Very helpful video! What color theme do you use btw?

  • @mahdi-hasan
    @mahdi-hasan Рік тому

    Thanks for blinding me.

  • @jakubl8271
    @jakubl8271 7 місяців тому

    Ok about TypeVar, yet there may be a time for finding out difference between class variables and instance variables?

  • @miguelfasanella6042
    @miguelfasanella6042 2 місяці тому

    I feel like I just unlocked a new skill in a videogame

  • @pylang3803
    @pylang3803 Рік тому

    Thank you. Well done as usual.

  • @mykun8737
    @mykun8737 Рік тому +2

    Could you tell me what themes you used on vs code, i saw beautifully

  • @igoromelchenko3482
    @igoromelchenko3482 Рік тому +1

    very educative, thanks

  • @TheCuriousConnoisseur
    @TheCuriousConnoisseur Рік тому

    great work boss.

  • @Patrick-hl1wp
    @Patrick-hl1wp Рік тому

    awesome explanation, thanks

  • @Golgafrincham
    @Golgafrincham Рік тому

    Great video, I have always wondered what the Generics and Variadic Generics where! One question I didn't get any answer to though. In the last example, can I create for example record2 with separate types or do the typing information get set when you create the first instance?
    I.e. Can I:
    record1 = Record(1, "Hello", 12.3, 1234)
    record2 = Record(1, 12.3, "Hello")
    Would this raise typing issues, or would the IDE/typing system successfully separate between the two objects? I do understand that it probably is really bad practice to do something like this, it is purely for understanding the limitations!

    • @AnthonyShaw
      @AnthonyShaw  Рік тому +1

      that would be perfectly valid. The typing information applies to the instance in that case

    • @AnthonyShaw
      @AnthonyShaw  Рік тому +2

      record1 = Record(1, "Hello", 12.3, 1234) # Record[int, str, float, int]
      record2 = Record(1, 12.3, "Hello") # Record[int, float, str]
      record2.update(12.3, "Hello") # OK
      record1.update("new word", 123., 32343) #OK

  • @mateuszsmendowski2677
    @mateuszsmendowski2677 Рік тому +1

    Great!🎉

  • @RaymondLee-hl8th
    @RaymondLee-hl8th Рік тому +2

    Awesome! But can you show how to enable the inline pylance warning?

  • @kleinesmaccify
    @kleinesmaccify Рік тому

    What is your zsh theme, sir?

  • @furkanonder-ut4mz
    @furkanonder-ut4mz Рік тому

    Awesome!

  • @blackcatdevel0per
    @blackcatdevel0per Рік тому +2

    11:25 Use dataclasses

  • @bruh-jr6wj
    @bruh-jr6wj Рік тому

    My eyes...

  • @i007c
    @i007c Рік тому

    white theme 🤣

  • @LordErnie
    @LordErnie Рік тому

    Dear mathematicians, please note that being good at math doesn't make one an engineer of softwre. Writing generics like this sounds like pain on a whole new level. I would rather use C++ templates than this. Generics themselves are a seperate set of parameters. Functions have value and type parameters, no more and no less. This is one of those cases where python just lacs intuitive support.

  • @Akonitx
    @Akonitx Рік тому

    How to get inline view of problem like you have on 1:40?

    • @AnthonyShaw
      @AnthonyShaw  Рік тому +1

      An extension called 'error lens' marketplace.visualstudio.com/items?itemName=usernamehw.errorlens