On Tue, Nov 25, 2014 at 5:48 PM, Patrick Stinson <patrickk...@gmail.com> wrote:
> Is it still possible to import non-module objects? I guess this question is
> just for fun now :)

rosuav@sikorsky:~$ python3
Python 3.5.0a0 (default:23ab1197df0b, Nov 20 2014, 12:57:44)
[GCC 4.7.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.modules["hello"]=lambda s: print("Hello, %s!"%s)
>>> import hello
>>> hello("world")
Hello, world!
>>>

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to