Quote:
Originally Posted by chaley
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.