121 | | Since a tuple is expected but a string provided, the code will merrily iterate over the characters of the string instead of the tuple elements - and that's where the single-char attribute names come from. |
| 121 | Remember, in python: |
| 122 | {{{ |
| 123 | #!python |
| 124 | >>> a = (1) ## This causes problems |
| 125 | 1 |
| 126 | >>> a = (1,) ## These are fine. |
| 127 | (1,) |
| 128 | >>> a = [1] |
| 129 | [1] |
| 130 | >>> a = [1,] |
| 131 | [1] |
| 132 | }}} |
| 133 | |
| 134 | Since a tuple is expected but a string provided, the code will merrily iterate over the characters of the string instead of the tuple elements - and that's where the single-char attribute names come from. If the commas are consistently causing you problems, try using brackets [] instead of parentheses. |