A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-March/147573.html below:

[Python-Dev] Python Design issue with print() function

[Python-Dev] Python Design issue with print() function [Python-Dev] Python Design issue with print() functionravi y y_ravi00 at yahoo.com
Wed Mar 8 07:38:14 EST 2017
Hi Python Developers,
print() function has a slight design issue, when user gives start and end positions of character array.Issue: >>> str_ary="abcdef" >>> print(str_ary[1]) b >>> print(str_ary[4]) e >>> print(str_ary[1:4]) bcd >>> 
 In the above scenario, user is expecting that output of print function will be bcde (not bcd).
Analysis: I kind of figured out what could be the issue.  To get the string slice, "between" (or equivalent) was used. i.e.  str_ary array position >=1 and < 4 Solution:   User experience will be better if the code is updated to get last character.   i.e str_ary array position >=1 and <= 4
Note: To keep the code as backward compatibility, you may come up with different name like printf() 
ThanksRavi Yarlagadda   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20170308/92ecd057/attachment.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4