Skip to content

Commit

Permalink
Fix B006 by declaring parameters immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jun 18, 2024
1 parent fe6230e commit e2a1370
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions googlevoice/voice.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging
import platform
import re
from collections.abc import Mapping

import requests

Expand Down Expand Up @@ -306,16 +307,17 @@ def __do_url(self, url, data=None, headers=None, terms=None):
method, url, data=data, params=terms or None, headers=headers
)

def __validate_special_page(self, page, data={}, **kwargs):
def __validate_special_page(self, page, data: Mapping = {}, **kwargs):
"""
Validates a given special page for an 'ok' response
"""
data.update(kwargs)
util.load_and_validate(self.__do_special_page(page, data))
util.load_and_validate(self.__do_special_page(page, dict(data) | kwargs))

_Phone__validate_special_page = __validate_special_page

def __do_special_page(self, page, data=None, headers={}, terms={}):
def __do_special_page(
self, page, data=None, headers: Mapping = {}, terms: Mapping = {}
):
"""
Add self.special to request data
"""
Expand All @@ -328,7 +330,9 @@ def __do_special_page(self, page, data=None, headers={}, terms={}):

_Phone__do_special_page = __do_special_page

def __get_xml_page(self, page, data=None, headers={}, terms={}):
def __get_xml_page(
self, page, data=None, headers: Mapping = {}, terms: Mapping = {}
):
"""
Return XMLParser instance generated from given page
"""
Expand Down

0 comments on commit e2a1370

Please sign in to comment.