rkern / line_profiler

(OLD REPO) Line-by-line profiling for Python - Current repo ->
https://github.com/pyutils/line_profiler
Other
3.61k stars 255 forks source link

TypeError: method() takes 1 positional argument but 2 were given #105

Closed Alexey-Akishin closed 5 years ago

Alexey-Akishin commented 6 years ago

Some methods, if I add @profile decorator to them, give the following error:

Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/line_profiler.py", line 104, in wrapper result = func(*args, **kwds) TypeError: method() takes 1 positional argument but 2 were given

The method have simple definition "def method(self)", and indeed takes only one argument. If more information is needed, please let me know. If needed, I can try to write simple example code which would trigger the issue.

Despite the error, line_profiler seems to be able to output profiling results for the method(), but I'm not sure if they are accurate.

caethan commented 6 years ago

A test case that shows the error would help if you can construct it.

caethan commented 5 years ago

Cannot replicate.