View Single Post
Old 01-30-2022, 08:13 AM   #10
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,201
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by chaley View Post
This fixes it by changing lstrip() to a slice, removing N characters from the beginning where N is the length of the outer user category name passed to the function (user_cat_prefix). As a side benefit it will be a bit faster.
I overlooked this, Thanks for the fix. I am thinking about going with re.sub() in case the user enters a wrong prefix. It will be slower though.
capink is offline   Reply With Quote