msg219514 - (view) |
Author: Robert w (Robert.w) |
Date: 2014-06-01 17:56 |
outer for loop loops more than one time, which should be impossible. |
|
|
msg219515 - (view) |
Author: SilentGhost (SilentGhost) *  |
Date: 2014-06-01 18:04 |
Robert, could you please post a reduced code that generates the bug. Preferably, a interpreter output. Including information about your python version, OS, etc. For example: Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> elements = [{'type': 2, 'data': {'elements': ['83H', '0FAH', '9AH', '27H', '81H', '49H', '0CEH', '11H']}}] >>> for i in elements: ... print(i) ... {'data': {'elements': ['83H', '0FAH', '9AH', '27H', '81H', '49H', '0CEH', '11H']}, 'type': 2} As you see from my example, I wasn't able to reproduce the issue you're reporting. |
|
|
msg219518 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2014-06-01 19:02 |
Oh, this is the same code as in issue 21630 that you closed. Since the loop is only executed once (as confirmed by adding a print), I suspect you have a bug in your expectations of the output :) |
|
|
msg219532 - (view) |
Author: Raymond Hettinger (rhettinger) *  |
Date: 2014-06-01 22:55 |
I've traced through your code and it doing exactly what it is specified to be doing (meaning that Python itself seems to be behaving correctly). Perhaps you wanted it to do something else, but that would be a bug in your own code. Please use the Python bug tracker for actual bugs in Python, not as a place to figure-out what your own code is doing. There are other forums that might be suitable (python-tutor, stackoverflow, etc). Thank you. |
|
|
msg219597 - (view) |
Author: Robert w (Robert.w) |
Date: 2014-06-02 15:54 |
banner C:\Users\r0b3\files\backuped\own_dropbox\programmierung\raymarcher0>C:\Python33\python Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. C:\Users\r0b3\files\backuped\own_dropbox\programmierung\raymarcher0>C:\Python33\python bug.py bug.py:45: SyntaxWarning: assertion is always true, perhaps remove parentheses? assert(False, "Should be unreachable!") {'data': {'elements': ['83H', '0FAH', '9AH', '27H', '81H', '49H', '0CEH', '11H']}, 'type': 2}INSIDE False False True {'data': {'elements': ['83H', '0FAH', '9AH', '27H', '81H', '49H', '0CEH', '11H']}, 'type': 2}INSIDE False False True db {'data': {'elements': ['83H', '0FAH', '9AH', '27H', '81H', '49H', '0CEH', '11H']}, 'type': 2}INSIDE False False True (and so on, some lines with the expected output, see the attached file) Either im totaly nuts and do *something* wrong, or it is a very weird bug... Im _not_ some random noob from the inet who doesn't know what a bugtracker is. --- Seems to be a weird memory issue. --- I closed the first version of the issue because i was confused between the words "issue" and "summaries" because issues...are bugs... |
|
|
msg219600 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2014-06-02 16:06 |
You may not be a noob, but on the other hand we can't see the bug. So your best bet would be to post your code to the python-list mailing list and ask for help refining your bug report into something we can take action on. |
|
|
msg219603 - (view) |
Author: Robert w (Robert.w) |
Date: 2014-06-02 16:28 |
i cutted it down ===== class EnumSectionContentType(object): DATABYTE = 2 DATADOUBLEWORD = 3 DATAWORD = 4 #LABEL = 0 def _getStringOfElements(elements): objectFileString = "" elements = [{'type': 2, 'data': {'elements': ['83H', '0FAH', '9AH', '27H', '81H', '49H', '0CEH', '11H']}}] for iterationElement in elements: objectFileString += "INSIDE1 " if iterationElement["type"] == EnumSectionContentType.LABEL: objectFileString += iterationElement["data"]["labelname"] + ":" + "\n" elif iterationElement["type"] == EnumSectionContentType.DATABYTE: objectFileString += "INSIDE" + "\n" if iterationElement["type"] == EnumSectionContentType.DATADOUBLEWORD: objectFileString += objectFileString + "dd " elif iterationElement["type"] == EnumSectionContentType.DATABYTE: objectFileString += objectFileString + "db " return objectFileString print(_getStringOfElements(None)) ===== I don't expect any output, I expect a exception (because LABEL is not defined) but hell no... i get ----- C:\Users\r0b3\Downloads>C:\Python34\python bug.py INSIDE1 INSIDE INSIDE1 INSIDE db ----- C:\Users\r0b3\Downloads>C:\Python34\python Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. |
|
|
msg219606 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2014-06-02 17:17 |
I get an exception. I think you need to be more careful with your testing. Please take this to python-list for further help. |
|
|