Geir Arne Hjelle - Plugins: Adding Flexibility to Your Apps - PyCon 2019

Поделиться
HTML-код
  • Опубликовано: 29 окт 2024

Комментарии • 1

  • @mishasawangwan6652
    @mishasawangwan6652 4 года назад +1

    apologies for the following comments (and this is just my opinion of course) but a couple thoughts: it would have been more interesting if the presenter talked about ‘pyplugs’ since that’s where the so-called ‘plugin system’ implementation is at.. but even then.. this package, ‘pyplugs’, is rather useless given the awesome functionality bundled with python3, and if you choose to use it ..well.. you’re just adding an unnecessary dependency and prbly much more overhead than required ... and the title of this talk.. misleading. what is shown here is basically the ‘registry pattern’ - a textbook example used in nearly all of the 1 billion decorator tutorial articles you find online. ie, a 30min talk for a 3min read. also to me, this isn’t an effective plugin system. a plugin system, and again this is just my opinion, allows your users to extend the core library/tool functionality ..with the stuff shown in this talk, there’s way too many steps for an outsider to ‘plugin’. it’s even alluded to in the questions. what we have here is more akin to parametric polymorphism (sorry if i got the terminology mixed up) and a demonstration of elementary oop concepts. anyway if that’s what you want and you want to do what this guy is doing, it‘s simpler to take advantage of abstract base classes and then use ‘__init_subclass__’ to do the registration. way easier. but hey if the bar is this low to do a talk at pycon, sign me up. i’d gladly do a talk on an actual plugin system. once more, apologies if my comments are harsh.