Невозможно указывать метод экземпляра объекта или классовый метод в качестве источника значения переменной #54

Closed
opened 1 year ago by icerider · 0 comments
icerider commented 1 year ago
class A:
    @classmethod
    def test(cls):
        return "test"


Variable("test", type=StringType, source=Calculate(A.test))
  File "/var/calculate/.project/trunk4/calculate-lib/calculate/variables/datavars.py", line 445, in check
    self._check_function(self.depend_function)                                                                        
  File "/var/calculate/.project/trunk4/calculate-lib/calculate/variables/datavars.py", line 500, in _check_function
    for node in ast.walk(ast.parse(getsource(function_to_check))):                                             
  File "/usr/lib64/python3.6/ast.py", line 35, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)                                                             
  File "<unknown>", line 1
    @classmethod                                                                                                      
    ^           
IndentationError: unexpected indent
``` class A: @classmethod def test(cls): return "test" Variable("test", type=StringType, source=Calculate(A.test)) ``` ``` File "/var/calculate/.project/trunk4/calculate-lib/calculate/variables/datavars.py", line 445, in check self._check_function(self.depend_function) File "/var/calculate/.project/trunk4/calculate-lib/calculate/variables/datavars.py", line 500, in _check_function for node in ast.walk(ast.parse(getsource(function_to_check))): File "/usr/lib64/python3.6/ast.py", line 35, in parse return compile(source, filename, mode, PyCF_ONLY_AST) File "<unknown>", line 1 @classmethod ^ IndentationError: unexpected indent ```
icerider added the
low
label 1 year ago
derzeitgeist closed this issue 1 year ago
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.