What steps will reproduce the problem?
1. Import gdata.analytics.client
2. Create any Query object from this module.
3. Update the object's query attribute
4. Create another Query object.
5. Notice the query remembers arguments from the first instance.
What is the expected output? What do you see instead?
Each object does not use a global query value.
What version of the product are you using?
It exists in the current source (Mar 31, 2011).
Please provide any additional information below.
You should not be declaring default arguments of a function with mutable types.
For example, looking at class gdata.analytics.client.DataFeedQuery, you define
the constructor using __init__(self, query={}, **kwargs). The query={} is the
problem here. It will only be instantiated once. You should really be
defining your constructor like the example below. This bug looks like it
exists all over the gdata.client code. I did not check any other modules.
def __init__(self, query=None, **kwargs):
self.query = query or {}
gdata.client.GDQuery(self, **kwargs)
Original issue reported on code.google.com by mjs7...@gmail.com on 31 Mar 2011 at 9:59
Original issue reported on code.google.com by
mjs7...@gmail.com
on 31 Mar 2011 at 9:59