(original) (raw)
This is a list for python interpreter development, not new ideas -- that list is python-ideas.
However, sorry to be blunt, but this post shows great ignorance of Python -- please study up more in the future before posting suggestions on any list.On Sat, Jan 28, 2017 at 8:21 AM, ravi y via Python-Dev <python-dev@python.org> wrote:
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 < 4Solution:User experience will be better if the code is updated to get last character.i.e str\_ary array position >=1 and <= 4Note: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/ chris.barker%40noaa.gov
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov