New submission from Wansoo Kim <rladhks...@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 <rep...@bugs.python.org> <https://bugs.python.org/issue41264> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com