[issue29162] pyshell.py: name 'sys' is not defined

Terry J. Reedy report at bugs.python.org
Wed Jan 4 23:28:20 EST 2017


Terry J. Reedy added the comment:

I agree that depending on the incidental import is a bug.  Tkinter could change, or I might change 'from tkinter import *' to 'from tkinter import Tk, ...' or 'import tkinter as tk'.

Serhiy, tkinter/__init__.py imports enum, sys, and re under their own names, so that * imports incidentally import them into other programs.  I believe it is customary for library modules to underscore stdlib imports to prevent this: "import enum as _enum", etc.  But I don't remember is this is in the devguide.  Do you think we should make the change to tkinter?

----------
nosy: +serhiy.storchaka
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29162>
_______________________________________


More information about the Python-bugs-list mailing list