[issue36872] passing negative values through modules
New submission from David Collins : program_data.py file contains a list import list_function str_list4 = ['i', 't'] str_list4 = list_function.insert_value(str_list4, 's', -1) print(str_list4) list_function.py file def insert_value(my_list, value, insert_position): counter = 0 print('Question 5') print(my_list, value, insert_position) for index in my_list: counter += 1 when passing the negative number in insert_position between the two modules this causes str_list4 = list_function.insert_value(str_list4, 's', -1) File "D:\part A\list_function.py", line 85, in insert_value for index in my_list: TypeError: 'NoneType' object is not iterable my_list now becomes lost, if the negative value is changed to positive this clears up . if you assign the -1 to a variable or a contstant it does not matter it still causes the same issue. however if you are running this code in the same module it works fine. this only seems to appear when attempting to pass between 2 modules a negative number. -- assignee: terry.reedy components: IDLE messages: 342049 nosy: coldy028, terry.reedy priority: normal severity: normal status: open title: passing negative values through modules type: compile error versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue36872> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36872] passing negative values through modules
David Collins added the comment: I have tested this in the Mac and PC versions of IDLE as well as in Spyder using Ipython. -- ___ Python tracker <https://bugs.python.org/issue36872> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36872] passing negative values through modules
David Collins added the comment: This is an issue with python On Fri, 10 May 2019 at 3:52 pm, SilentGhost wrote: > > Change by SilentGhost : > > > -- > components: -IDLE > > ___ > Python tracker > <https://bugs.python.org/issue36872> > ___ > -- ___ Python tracker <https://bugs.python.org/issue36872> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36872] passing negative values through modules
David Collins added the comment: Not the coding On Fri, 10 May 2019 at 3:53 pm, David Collins wrote: > This is an issue with python > > On Fri, 10 May 2019 at 3:52 pm, SilentGhost > wrote: > >> >> Change by SilentGhost : >> >> >> -- >> components: -IDLE >> >> ___ >> Python tracker >> <https://bugs.python.org/issue36872> >> ___ >> > -- ___ Python tracker <https://bugs.python.org/issue36872> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36872] passing negative values through modules
David Collins added the comment: So what your saying is that python is unable to pass a negative number between modules and you don’t think that this is an issue . Sent from Mail for Windows 10 From: Terry J. Reedy Sent: Friday, 10 May 2019 7:21 PM To: coldy...@gmail.com Subject: [issue36872] passing negative values through modules Terry J. Reedy added the comment: David, the tracker 'component' is intended to be, for bug reports, the component of Python that you think has a bug. When you run your code with IDLE and you get an exception displayed, that almost certainly means that IDLE is working as intended: it ran your code with python and displayed the error reported by python. The fact that you got the same error when running without IDLE (and this is a good thing to try) demonstrates that the error is not from IDLE. -- assignee: terry.reedy -> ___ Python tracker <https://bugs.python.org/issue36872> ___ -- ___ Python tracker <https://bugs.python.org/issue36872> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36872] passing negative values through modules
David Collins added the comment: Sorry for being so abrupt you are correct . The code I was working from was a university professors and not my own, I understood better thanks steve. I wasn’t passing a return value yet and the professors work was overwriting the list. I do apologise. Thanks for you support. -- ___ Python tracker <https://bugs.python.org/issue36872> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com