aiocometd
aiocometd copied to clipboard
TypeError: outgoing() takes 2 positional argument but 3 were given
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>`
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>