toggle method

toggle

Removes the token from the list if it exists, or adds the token to the list if it doesn’t.

Returns

A Boolean indicating whether token is in the list after the call.

def toggle(self, token):
    ...
ParameterTypeDescription
tokenstrThe token you want to toggle.

toggle

Removes the token from the list if it exists, or adds the token to the list if it doesn’t.

Returns

A Boolean indicating whether token is in the list after the call.

def toggle(self, token, force):
    ...
ParameterTypeDescription
tokenstrThe token you want to toggle.
forceboolA Boolean that, if included, turns the toggle into a one way-only operation. If set to false, then token will only be removed, but not added. If set to true, then token will only be added, but not removed.

See Also