Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Why tkinter overloading is only used for basically equivalent operations

Shulou Source: shulou.com Published: 2022-06-01 03:35:02 10月03日 Update

In this article, the editor introduces in detail "Why tkinter overload is only used for basic equivalent operations". The content is detailed, the steps are clear, and the details are handled properly. I hope this "Why tkinter overload is only used for basic equivalent operations" article can help you solve your doubts.

Overloading is only used for basically equivalent operations

Reason (reason)

Logically different functions using the same name can cause confusion and easily lead to errors when using them for common programming.

Example (sample)

Consider (consider the following code):

Void open_gate (Gate& g); / / remove obstacle from garage exit lane

Void fopen (const char* name, const char* mode); / / open file

The two operations are fundamentally different (and not associated), so it's good that they use different names. On the contrary:

Void open (Gate& g); / / remove obstacle from garage exit lane

Void open (const char* name, const char* mode = "r"); / / open file

These are two fundamentally different operations (and unrelated), but the names have been compressed to a (common) minimum, which increases the possibility of confusion. Fortunately, many of these errors are caught by the system.

Note (Note)

Pay special attention to those common and common names, such as open,move,+ and =.

After reading this, the article "Why tkinter overloading is only used for basic equivalent operations" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself. If you want to know more about related articles, you are welcome to follow the industry information channel.

Tags: Equivalence difference name article two content fundamental error association proper minimum same lucky code practice function reason possibility name common Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Docker Shulou Tech Info Xiaomi macOS