Skip to content

Commit eb67445

Browse files
committed
Better monkey-patching example
1 parent d65eae1 commit eb67445

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ You could also monkey-patch its methods in the global `urlparse` module like thi
3434
import urlparse4
3535
import urlparse
3636
37-
urlparse.urlsplit = urlparse4.urlsplit
38-
...
37+
for attr in dir(urlparse4):
38+
setattr(urlparse, attr, getattr(urlparse4, attr))
39+
3940
```
4041

4142
## How to test

0 commit comments

Comments
 (0)