how does python's module `__getattr__` actually work?

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

КОМЕНТАРІ • 11

  • @AlexWaygood
    @AlexWaygood Місяць тому +20

    Fun video - and sorry for breaking your script by adding the module-level __getattr__ to typing!

  • @jtw-r
    @jtw-r Місяць тому +2

    The double take at 12:57 😂

  • @anuragmodi4192
    @anuragmodi4192 Місяць тому

    Oh, i watch you constantly. Though lot of times things go on top of my head.
    I suggest you to create a python course (intermediate & advanced). It will be useful to learn from you. You might have to spend time to organise the contents you might wanna cover.

  • @Papalotis97
    @Papalotis97 Місяць тому

    Could one copy the contents of the typing.py to, let's say, /tmp/oldtypingmoddules, with a unique name, add it to sys.path and import that with importlib, instead of having to mock the import system?

    • @anthonywritescode
      @anthonywritescode  Місяць тому

      you would have to give it a different name and it might work (though there's some meta programming in typing that iirc needs the name to be consistent) -- otherwise parts of the stdlib would be broken

  • @Asgallu
    @Asgallu Місяць тому

    Thanks

  • @wagneralberto5456
    @wagneralberto5456 Місяць тому +3

    FIRST!

  • @thecodealchemist7095
    @thecodealchemist7095 Місяць тому

    😂 yaya

  • @mrswats
    @mrswats Місяць тому

    Foofoo 😂

    • @qexat
      @qexat Місяць тому +3

      I did get my attrs today