Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Odd Syntax Errors
#5
So I made this test:

class Foo(object):

    aliases = {'b': 'bar', 's': 'spam' 'e': 'eggs'}

    def do_bar(self, arguments):
        return [ for argument in arguments]
This was the situation I had with the errors posted above: The first error that was detected was in a method, and the second error that was detected was in a previously defined class attribute of the same class. As you can test for yourself, this snippet does not have the same behavior I mentioned above. When run, the syntax error on line 3 is detected first, as you would expect. I guess I did modify it in between runs, and then spaced out about it.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Odd Syntax Errors - by ichabod801 - Oct-27-2019, 08:38 PM
RE: Odd Syntax Errors - by Gribouillis - Oct-27-2019, 08:57 PM
RE: Odd Syntax Errors - by buran - Oct-28-2019, 08:41 AM
RE: Odd Syntax Errors - by ichabod801 - Oct-28-2019, 12:34 PM
RE: Odd Syntax Errors - by ichabod801 - Oct-28-2019, 02:12 PM
RE: Odd Syntax Errors - by Gribouillis - Oct-28-2019, 02:42 PM
RE: Odd Syntax Errors - by ichabod801 - Oct-28-2019, 03:02 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020