Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
n4arora opened this issue Sep 19, 2020 · 1 comment
Open

Comments

@n4arora
Copy link

n4arora commented Sep 19, 2020

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>`
@alex55132
Copy link

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants