Skip to content

fix: replace redundant import with explicit tk alias#29

Open
arawrdn wants to merge 1 commit into
Aashishkumar123:masterfrom
arawrdn:master
Open

fix: replace redundant import with explicit tk alias#29
arawrdn wants to merge 1 commit into
Aashishkumar123:masterfrom
arawrdn:master

Conversation

@arawrdn
Copy link
Copy Markdown

@arawrdn arawrdn commented May 17, 2026

GM,

Fixed redundant dual import (from tkinter import * + import tkinter as tk) that caused tk to shadow the module—tk.Tk() was invalid since tk resolved to the Tk class, not the module. Refactored to single import tkinter as tk for explicit, unambiguous access.

Why: * imports pollute the global namespace, risk name collisions, and add runtime overhead. Explicit tk. prefix improves readability, avoids shadowing, and aligns with Python best practices (PEP 8). Gas-heavy? Nah—just clean, predictable, and maintainable.

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant