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
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com