Warum frühe Importe zur Bevölkerung von sys.modulePython

Python-Programme
Guest
 Warum frühe Importe zur Bevölkerung von sys.module

Post by Guest »

https://github.com/stripe/stripe-python ... _init__.py
# We must import the app_info module early to populate it into
# `sys.modules`; otherwise doing `import stripe.app_info` will end up
# importing that module, and not the global `AppInfo` name from below.
import stripe.app_info
from stripe._app_info import AppInfo as AppInfo
from stripe._version import VERSION as VERSION
< /code>
Was ist gemeint mit stripe.app_info muss früh importiert werden, um zu verhindern, dass Appinfo importiert wird? >
Versuchte Chatgpt, sie sagen, es ist etwas mit der Defensivprogrammierung, um Fehler zu verhindern.>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post