Third iteration. Fixed the weird syntax highlighting (as a result, the diff looks more extensive than it really is - use view "Side-by-side Markdown" to compare).
Peter Mortensen
- 31.3k
- 22
- 110
- 134
python2 lib.foo
python2 lib.foo
python3 lib.foo
python3 lib.foo
Package named 'lib'; __name__ is '__main__'
Package named 'lib'; __name__ is '__main__'
python2 lib.foo
python2 lib.foo
Package named 'lib'; __name__ is 'lib.foo'
Package named 'lib'; __name__ is '__main__'
Package named 'lib'; __name__ is 'lib.foo'
Package named 'lib'; __name__ is '__main__'
python3 lib.routine
python3 lib.routine
Package named 'lib'; __name__ is 'lib.foo'
[...]/runpy.py:125: RuntimeWarning: 'lib.foo' found in sys.modules
after import of package 'lib', but prior to execution of 'lib.foo';
this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
Package named 'lib'; __name__ is '__main__'
Package named 'lib'; __name__ is 'lib.foo'
[...]/runpy.py:125: RuntimeWarning: 'lib.foo' found in sys.modules
after import of package 'lib', but prior to execution of 'lib.foo';
this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
Package named 'lib'; __name__ is '__main__'
python2 lib.foo
python3 lib.foo
Package named 'lib'; __name__ is '__main__'
python2 lib.foo
Package named 'lib'; __name__ is 'lib.foo'
Package named 'lib'; __name__ is '__main__'
python3 lib.routine
Package named 'lib'; __name__ is 'lib.foo'
[...]/runpy.py:125: RuntimeWarning: 'lib.foo' found in sys.modules
after import of package 'lib', but prior to execution of 'lib.foo';
this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
Package named 'lib'; __name__ is '__main__'
python2 lib.foo
python3 lib.foo
Package named 'lib'; __name__ is '__main__'
python2 lib.foo
Package named 'lib'; __name__ is 'lib.foo'
Package named 'lib'; __name__ is '__main__'
python3 lib.routine
Package named 'lib'; __name__ is 'lib.foo'
[...]/runpy.py:125: RuntimeWarning: 'lib.foo' found in sys.modules
after import of package 'lib', but prior to execution of 'lib.foo';
this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
Package named 'lib'; __name__ is '__main__'
Peter Mortensen
- 31.3k
- 22
- 110
- 134
$ python2 lib.foo
$ python3 lib.foo
$ python2 lib.foo
Output:
Package named 'lib'; __name__ is 'lib.foo'
Package named 'lib'; __name__ is '__main__'
$ python3 lib.routine
Output:
Package named 'lib'; __name__ is 'lib.foo'
[...]/runpy.py:125: RuntimeWarning: 'lib.foo' found in sys.modules
after import of package 'lib', but prior to execution of 'lib.foo';
this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
Package named 'lib'; __name__ is '__main__'
$ python2 lib.foo
$ python3 lib.foo
$ python2 lib.foo
Package named 'lib'; __name__ is 'lib.foo'
Package named 'lib'; __name__ is '__main__'
$ python3 lib.routine
Package named 'lib'; __name__ is 'lib.foo'
[...]/runpy.py:125: RuntimeWarning: 'lib.foo' found in sys.modules
after import of package 'lib', but prior to execution of 'lib.foo';
this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
Package named 'lib'; __name__ is '__main__'
python2 lib.foo
python3 lib.foo
python2 lib.foo
Output:
Package named 'lib'; __name__ is 'lib.foo'
Package named 'lib'; __name__ is '__main__'
python3 lib.routine
Output:
Package named 'lib'; __name__ is 'lib.foo'
[...]/runpy.py:125: RuntimeWarning: 'lib.foo' found in sys.modules
after import of package 'lib', but prior to execution of 'lib.foo';
this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
Package named 'lib'; __name__ is '__main__'
Active reading [<https://en.wikipedia.org/wiki/History_of_Python#Version_2> <https://en.wikipedia.org/wiki/History_of_Python#Version_3>].
Peter Mortensen
- 31.3k
- 22
- 110
- 134
The idea here is this (and note that these all function the same across python2Python 2.7 and python 3Python 3.x):
The idea here is this (and note that these all function the same across python2.7 and python 3.x):
The idea here is this (and note that these all function the same across Python 2.7 and Python 3.x):
Loading
URL Rewriter Bot
Loading
lang-py