Sign in
Log inSign up

Why does __import__({module},{fromlist=[methods...]}) give me all the methods?

Dandy Cheng's photo
Dandy Cheng
·Dec 29, 2018

From what I've read from forums, in order to import certain methods from modules for runtime, something like this is required:

Screenshot from 2018-12-30 00-27-28.png

But I realized that doing that gives me all the methods I need. Does that mean that I can just replace that with:

Screenshot from 2018-12-30 00-29-00.png

and use the dot operator to access the method?

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct