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

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

КОМЕНТАРІ • 11

  • @AlexWaygood
    @AlexWaygood 5 днів тому +19

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

  • @jtw-r
    @jtw-r 5 днів тому +2

    The double take at 12:57 😂

  • @anuragmodi4192
    @anuragmodi4192 5 днів тому

    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.

  • @Asgallu
    @Asgallu 6 днів тому

    Thanks

  • @Papalotis97
    @Papalotis97 5 днів тому

    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  5 днів тому

      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

  • @wagneralberto5456
    @wagneralberto5456 6 днів тому +3

    FIRST!

  • @thecodealchemist7095
    @thecodealchemist7095 6 днів тому

    😂 yaya

  • @mrswats
    @mrswats 6 днів тому

    Foofoo 😂

    • @qexat
      @qexat 6 днів тому +3

      I did get my attrs today