[issue37557] Example snippets for simpler functions/methods

2019-07-10 Thread Kishore


New submission from Kishore :

Is there a reason why many (not all) of the simpler methods lack example 
snippets?

Snippets which are present:

1. https://docs.python.org/3/library/stdtypes.html#str.rstrip
2. https://docs.python.org/3/library/stdtypes.html#str.strip

Snippets which are not present:

1. https://docs.python.org/3/library/stdtypes.html#str.lower
2. https://docs.python.org/3/library/stdtypes.html#str.upper
3. https://docs.python.org/3/library/stdtypes.html#str.isupper

Is there any recommendation against adding concise example snippets for all 
methods?

I am of the opinion that short examples are more easier to read and visually 
skim through, than reading the description. I was hoping I could add example 
snippets to the simpler methods if anyone does not have any objection towards 
it.

--
assignee: docs@python
components: Documentation
messages: 347656
nosy: docs@python, kishvanchee
priority: normal
severity: normal
status: open
title: Example snippets for simpler functions/methods
type: enhancement

___
Python tracker 
<https://bugs.python.org/issue37557>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34119] Able to name a variable as 'input'. This creates problem when using input() function.

2018-07-14 Thread Kishore Aadada


New submission from Kishore Aadada :

When i used input as a variable name, there is no error provided. After that I 
am calling input() function to read data. In such case, below error is reported.

Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 17:26:49) [MSC v.1900 32 bit 
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> input = "Test input"
>>> data = input("Please enter some input")
Traceback (most recent call last):
  File "", line 1, in 
data = input("Please enter some input")
TypeError: 'str' object is not callable
>>>

--
components: IO
files: inputError.png
messages: 321680
nosy: kishoreaadada
priority: normal
severity: normal
status: open
title: Able to name a variable as 'input'. This creates problem when using 
input() function.
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47692/inputError.png

___
Python tracker 
<https://bugs.python.org/issue34119>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com