Azure / msrest-for-python

The runtime library "msrest" for AutoRest generated Python clients.
MIT License
41 stars 64 forks source link

Default argument value is mutable #20

Closed liketic closed 7 years ago

liketic commented 7 years ago

Hi,

Just want to confirm, I noticed there are some methods in ServiceClient contain a mutable default argument, for instance: `def get(self, url=None, params={}): """Create a GET request object.

    :param str url: The request URL.
    :param dict params: Request URL parameters.
    """
    request = self._request(url, params)
    request.method = 'GET'
    return request`

And the default argument params is changed inself._request(url, params). Is that as design? I just think it's a little wired. Thanks!

lmazuel commented 7 years ago

Hi @likel You're right it's weird, I will check. Thanks for the report!