If I have a module Unless I import the module, I do not use the functions defined in them I will. / P> But all the functions in the Is this something like the above? But if I do error of name: name 'zip' is not defined Can anyone please explain this behavior? As explained, names in python are first solved by viewing in local area , Then in any enclosed area, then in module-level area and finally in the namespace of built-in So there are special cases inherent in the way they are not imported within the scope of their modules, but if no name is found anywhere, then Python should have it Note that you can access the content of this radius without importing it. To do this, a portable way in CPython, also but it is considered an implementation description and for other Python implementations or future versions May not be available. test and I have to list all those functions, then I Do this:
Import Test DIR (Test)
__Biltin___ module can be used without importing. But without the
import __builtin __ I am not able to do a
dir (__ builtin __) . Does this mean that we use the work without importing the whole module?
__builtin__ import zip to
del zip , then I
__ underlying __ Will look in
import system print (DIR (sys.modules ["__ builtin__"]))
print (dir (__ buildins__))
Comments
Post a Comment