The "loop and a half"
Robin Becker
robin at reportlab.com
Wed Oct 4 05:01:07 EDT 2017
More information about the Python-list mailing list
Wed Oct 4 05:01:07 EDT 2017
- Previous message (by thread): The "loop and a half"
- Next message (by thread): The "loop and a half"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Given the prevalence of the loop and a half idea in python I wonder why we don't have a "do" or "loop" statement to start loops without a test. > C:\Python27\Lib>grep "while True" *.py | wc -l > 99 > > C:\Python27\Lib>grep "while 1" *.py | wc -l > 117 > C:\Python36\Lib>grep "while True" *.py | wc -l > 131 > > C:\Python36\Lib>grep "while 1" *.py | wc -l > 44 How much does the while True actually cost compared to nothing? -- Robin Becker
- Previous message (by thread): The "loop and a half"
- Next message (by thread): The "loop and a half"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list