View Single Post
Old 02-03-2022, 08:16 AM   #16
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,200
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by chaley View Post
Ahh, I see. That makes sense. However, don't you need to change/get rid of the dict comprehension on line 5? It ensures that only user categories with the prefix used are put into the "cats" dict, making it impossible for the re.sub() to fail.
You are right. I am going with your modified version instead. I think performance wise, it is the best.
capink is offline   Reply With Quote