[New-bugs-announce] [issue41264] Do not use the name of the built-in function as a variable.
Wansoo Kim
report at bugs.python.org
Fri Jul 10 02:55:52 EDT 2020
New submission from Wansoo Kim <rladhkstn8 at gmail.com>:
Using the name of the built-in function as a variable can cause unexpected problems.
```
# example
type = 'Hello'
...
type('Happy')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'str' object is not callable
```
You can go back without any problems right now, but you may have problems later when others make corrections.
This code can be returned without any problems right now, but it may cause problems later when others make a change.
In the Lib/xml/etree function/_default, assign a value for the type.
```
...
type = self._doctype[1]
if type == "PUBLIC" and n == 4:
name, type, pubis, system = self._doctype
...
```
----------
messages: 373442
nosy: ys19991
priority: normal
severity: normal
status: open
title: Do not use the name of the built-in function as a variable.
type: enhancement
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41264>
_______________________________________
More information about the New-bugs-announce
mailing list