Python Forum
can't assign to literal error in pycharm
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
can't assign to literal error in pycharm
#1
class Flee(Action):
    def __init__(self, method: object, name: object, hotkey: object, kwargs: object) -> object:
        """

        :rtype: object
        """
        super().__init__(method, name, hotkey, kwargs)
        super().__init(method=player.Player.)not, name= "Flee", hotkey= 'f')
Can't assign to literal on line 6
Reply
#2
You should provide fully-runnable code that reproduces the issue. You should leave out things like the docstring (and maybe even the annotations, especially if they're just object) to keep it as minimal as possible.

Also, on line 8 that's clearly not legal syntax.
Feel like you're not getting the answers you want? Checkout the help/rules for things like what to include/not include in a post, how to use code tags, how to ask smart questions, and more.

Pro-tip - there's an inverse correlation between the number of lines of code posted and my enthusiasm for helping with a question :)
Reply
#3
try backing your triple quotation marks back to your object on line 5
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  REGEX Install Error in PyCharm charlesauspicks 1 570 May-14-2020, 08:10 PM
Last Post: buran
  Traceback error in PyCharm but not in other IDEs? devansing 7 977 Mar-05-2020, 11:27 AM
Last Post: buran
  Error in importing package in pycharm fullstop 0 457 Dec-12-2019, 04:03 PM
Last Post: fullstop
  Syntax Error EOL while scanning string literal intjuma 0 899 Jun-28-2019, 01:56 AM
Last Post: intjuma
  Weird error in pycharm TheRedFedora 1 1,113 Mar-11-2018, 09:01 PM
Last Post: Larz60+
  why does integer input give error invalid literal for int() PyPhanman 2 4,049 Apr-27-2017, 05:32 AM
Last Post: ndc85430
  python turtle module in pycharm error sajley 2 8,966 Dec-12-2016, 08:52 PM
Last Post: sajley

Forum Jump:

User Panel Messages

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