This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xtreak
Recipients iitkgp.ketan@gmail.com, remi.lapeyre, xtreak
Date 2019-03-07.10:45:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1551955510.23.0.759526387941.issue36223@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-03-07 10:45:10xtreaksetrecipients: + xtreak, remi.lapeyre, iitkgp.ketan@gmail.com
2019-03-07 10:45:10xtreaksetmessageid: <1551955510.23.0.759526387941.issue36223@roundup.psfhosted.org>
2019-03-07 10:45:10xtreaklinkissue36223 messages
2019-03-07 10:45:10xtreakcreate