PyCharm console and decorators

已回答

I have a module that looks like this:

import functools


def decorator(f):
@functools.wraps(f)
def wrapper(*args, **kwargs):
print('hello world')
result = f(*args, **kwargs)
return result
return wrapper


@decorator
def add(a, b):
print(a + b)

In the editor, if I then type `add(` and hit CTRL+P, I see "a,b" as the parameter hints, as I would expect. 

However, in the PyCharm console, I see "(*args, **kwargs)" as the parameter hints, which is not helpful or desired. Is this a bug in the PyCharm console?

0

Hi, thank you for the report. Yeap, looks like an issue in the console, I've created a ticket in our bug tracker: PY-30955.

0

请先登录再写评论。