Python Forum
documentation is wrong for exec()
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
documentation is wrong for exec()
#6
MCVE? i don't know what that means.

here is a simple demo:
Output:
lt2a/forums /home/forums 45> py3 Python 3.6.8 (default, Jan 14 2019, 11:02:34) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux Type "help", "copyright", "credits" or "license" for more information. >>> a='print(repr((a,b,c,d,e,f)))\n' >>> b='print(repr((a,b,c,d,e,f)))\r' >>> c='print(repr((a,b,c,d,e,f)))\r\n' >>> d=b'print(repr((a,b,c,d,e,f)))\n' >>> e=b'print(repr((a,b,c,d,e,f)))\r' >>> f=b'print(repr((a,b,c,d,e,f)))\r\n' >>> exec(a) ('print(repr((a,b,c,d,e,f)))\n', 'print(repr((a,b,c,d,e,f)))\r', 'print(repr((a,b,c,d,e,f)))\r\n', b'print(repr((a,b,c,d,e,f)))\n', b'print(repr((a,b,c,d,e,f)))\r', b'print(repr((a,b,c,d,e,f)))\r\n') >>> exec(b) ('print(repr((a,b,c,d,e,f)))\n', 'print(repr((a,b,c,d,e,f)))\r', 'print(repr((a,b,c,d,e,f)))\r\n', b'print(repr((a,b,c,d,e,f)))\n', b'print(repr((a,b,c,d,e,f)))\r', b'print(repr((a,b,c,d,e,f)))\r\n') >>> exec(c) ('print(repr((a,b,c,d,e,f)))\n', 'print(repr((a,b,c,d,e,f)))\r', 'print(repr((a,b,c,d,e,f)))\r\n', b'print(repr((a,b,c,d,e,f)))\n', b'print(repr((a,b,c,d,e,f)))\r', b'print(repr((a,b,c,d,e,f)))\r\n') >>> exec(d) ('print(repr((a,b,c,d,e,f)))\n', 'print(repr((a,b,c,d,e,f)))\r', 'print(repr((a,b,c,d,e,f)))\r\n', b'print(repr((a,b,c,d,e,f)))\n', b'print(repr((a,b,c,d,e,f)))\r', b'print(repr((a,b,c,d,e,f)))\r\n') >>> exec(e) ('print(repr((a,b,c,d,e,f)))\n', 'print(repr((a,b,c,d,e,f)))\r', 'print(repr((a,b,c,d,e,f)))\r\n', b'print(repr((a,b,c,d,e,f)))\n', b'print(repr((a,b,c,d,e,f)))\r', b'print(repr((a,b,c,d,e,f)))\r\n') >>> exec(f) ('print(repr((a,b,c,d,e,f)))\n', 'print(repr((a,b,c,d,e,f)))\r', 'print(repr((a,b,c,d,e,f)))\r\n', b'print(repr((a,b,c,d,e,f)))\n', b'print(repr((a,b,c,d,e,f)))\r', b'print(repr((a,b,c,d,e,f)))\r\n') >>>
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
documentation is wrong for exec() - by Skaperen - Jul-27-2019, 12:33 AM
RE: documentation is wrong for exec() - by Skaperen - Jul-27-2019, 06:33 PM
RE: documentation is wrong for exec() - by Skaperen - Jul-27-2019, 10:56 PM
RE: documentation is wrong for exec() - by Skaperen - Jul-28-2019, 06:49 AM
RE: documentation is wrong for exec() - by buran - Jul-28-2019, 07:33 AM
RE: documentation is wrong for exec() - by Skaperen - Jul-28-2019, 02:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  exec() instead of functions Skaperen 5 2,563 Aug-03-2020, 11:12 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020