Karthikeyan Singaravelan <tir.kar...@gmail.com> added the comment:
Agreed with @remi.lapeyre. There is no delayed evaluation in Python and this is not only related to print but it's the general evaluation model in Python. Another example as below since foo(1) is used as an argument it's evaluated first and then the return value is passed. def bar(a, b): print("bar ", a, b) return (a, b) def foo(b): print("foo ", b) return b bar(foo(1), 2) # foo is first evaluated to pass 1 bar $ python3 /tmp/foo.py foo 1 bar 1 2 Closing this as not a bug. ---------- nosy: +xtreak resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36223> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com