aiocometd icon indicating copy to clipboard operation
aiocometd copied to clipboard

TypeError: outgoing() takes 2 positional argument but 3 were given

Open n4arora opened this issue 4 years ago • 1 comments

Hi,

I'm not too much familiar with Python or cometD but I was trying my way out and when trying to implement the AuthExtension, for the outgoing function I'm getting this type error

TypeError: outgoing() takes 2 positional argument but 3 were given

Here is the code for that class

`class MyAuthExtension(AuthExtension):

async def incoming(payload, headers=None):
    pass

async def outgoing(payload, headers):
    pass    

async def authenticate():
    return <SOME_VALUE>`

n4arora avatar Sep 19 '20 10:09 n4arora

The documentation doesn't specify it until the reference. But the correct way to set this is by specifying a self parameter along the other 2.

async def incoming(self, payload, headers=None):
    pass

async def outgoing(self, payload, headers):
    pass    

async def authenticate():
    return <SOME_VALUE>

alex55132 avatar Jul 06 '21 11:07 alex55132