GrandMoff100 / RegexFactory

Dynamically construct regex patterns with native python representations
https://regexfactory.readthedocs.io
GNU General Public License v3.0
7 stars 4 forks source link

Don't define different classes for each character #3

Closed ItsDrike closed 2 years ago

ItsDrike commented 2 years ago

Currently, in the chars.py, you define custom classes for each special character. This is very weird behavior as it defies the purpose of classes in the first place. Each class should be a template and it is expected to be instantiated multiple times making different objects based on that blueprint. Making class singletons like these should generally be discouraged.

I've also removed the RegexChar class as a whole, since it was basically doing the same thing as RegexPattern except it was only supposed to contain one character (which wasn't actually enforced by the class).

GrandMoff100 commented 2 years ago

Thanks!

That makes sense. I'll review it real quick.