Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/data/messages/u/use-maxsplit-arg/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
url = "www.example.com"
suffix = url.split(".")[-1] # [use-maxsplit-arg]
3 changes: 3 additions & 0 deletions doc/data/messages/u/use-maxsplit-arg/details.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Be aware that the performance improvement from not splitting the string
so many times will only be realized in cases presenting more instances of
the splitting character than the minimal example here.
2 changes: 2 additions & 0 deletions doc/data/messages/u/use-maxsplit-arg/good.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
url = "www.example.com"
suffix = url.rsplit(".", maxsplit=1)[-1]