Skip to content

Commit

Permalink
Remove deepcopy usage and ensure URL state isn't modified during call.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgilland committed May 6, 2014
1 parent f779877 commit 92be688
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
@@ -1,3 +1,7 @@
## v0.2.4 (2014-05-06)

- Remove usage of `deepcopy` and ensure `URL` state isn't modified during regeneration.

## v0.2.3 (2014-05-06)

- Fix bug where including params in `URL()` resulted in previous instance's params being modified, i.e., `x = URL('/'); y = x(a=1)` resulted in `a=1` being added to `x`.
Expand Down
5 changes: 2 additions & 3 deletions ladder/ladder.py
Expand Up @@ -2,7 +2,6 @@
"""

from functools import partial
from copy import deepcopy

from ._compat import (
text_type,
Expand Down Expand Up @@ -70,7 +69,7 @@ def __getstate__(self):
state = dict((attr.replace('__', ''), getattr(self, attr, None))
for attr in self.__attrs__)

return deepcopy(state)
return state

def __geturl__(self):
"""Return current URL as string. Combines query string parameters found
Expand Down Expand Up @@ -122,7 +121,7 @@ def __call__(self, *paths, **params):
state = self.__getstate__()

state['url'] = urlpathjoin(state['url'], *paths)
state['params'] += list(iteritems(params))
state['params'] = state['params'] + list(iteritems(params))

# Use `__class__` to spawn new generation in case we are a subclass.
return self.__class__(**state)
Expand Down

0 comments on commit 92be688

Please sign in to comment.