Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
Brython - Python in the browser
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Chris Angelico, post: 5067385"] Agreed, and it's sometimes confusing. I don't see "string % tuple" as a good syntax; I prefer to spell it sprintf("format",arg,arg,arg). When it comes to operators on strings, what I'd prefer to see is something that does more-or-less what the operator does with integers - for instance: "This is a string" / " " ==> ["This","is","a","string"] Taking a string modulo a tuple doesn't make any sense in itself, so it CAN be given an alternative meaning. But if you see that in a program and aren't sufficiently familiar with %s formatting to recognize it, how are you going to locate the documentation on the subject? Googling for 'python % string' doesn't help; 'python string modulo' brings up an article on informit.com that explains the matter, but nothing official. By contrast, searching for 'c sprintf' brings up heaps of useful links, because 'sprintf' is a searchable keyword. On the flip side, operator-based notations end up a lot more compact. I'd definitely not want to give up, for instance, list comprehension syntax. Difficulty of searching for docs is a downside, but definitely not a blocker. ChrisA [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
Brython - Python in the browser
Top