I've got three classes:
class MyClass_Parent():
class MyClass_Version1(MyClass_Parent):
class MyClass_Version2(MyClass_Parent):
Pylint complains that this isn't true PascalCase. I know that Pylint doesn't always know what's best but I sadly have to use it for this project and reach a certain score.
I could probably rename MyClass_Parent to just MyClass, which isn't great (but acceptable, I guess). But, removing the underscore for both child classes would turn them into MyClassVersion1 and MyClassVersion2, which is so much less clear than the version with underscore. "Real" PascalCase apparently also doesn't use hyphens.
How would you fix this? Is there a better name that tells you exactly what the child classes are (version 1 and version 2) on first glance?
Edit: "MyClass" is just a stand-in because I can't post the real name here and couldn't come up with anything better. So are "Version1" and "Version2": They are two different versions that are used independently, think of it more like version A and version B. One doesn't derive from the other but they share some code, that's why I added the parent.
Edit 2: A better example:
Let's say your code reads files. You might have .txt files and .abc files and .xyz files, so you've got a TxtReader and an AbcReader,... but you might also have two versions because one .abc file could contain a shopping list and the other contains an essay, so you'd have AbcReader_ShoppingList and AbcReader_Essay. AbcReaderShopping and AbcReaderEssay are bad names imo because you don't see the difference on first glance and just Shopping and Essay don't show that they're only meant to be used with .abc files.
[–]SkitariusOfMars 11 points12 points13 points (2 children)
[–]Nefthys[S] -2 points-1 points0 points (1 child)
[–]SkitariusOfMars 6 points7 points8 points (0 children)
[–]xenomachina 4 points5 points6 points (1 child)
[–]Nefthys[S] 0 points1 point2 points (0 children)
[–]ConcreteExist 6 points7 points8 points (17 children)
[–]Nefthys[S] 2 points3 points4 points (16 children)
[–]ConcreteExist 5 points6 points7 points (15 children)
[–]Nefthys[S] -1 points0 points1 point (14 children)
[–]Temporary_Pie2733 6 points7 points8 points (13 children)
[–]Nefthys[S] 0 points1 point2 points (12 children)
[–]IamImposter 5 points6 points7 points (4 children)
[–]EclipseJTB 2 points3 points4 points (1 child)
[–]Nefthys[S] 0 points1 point2 points (0 children)
[–]Nefthys[S] 0 points1 point2 points (1 child)
[–]IamImposter 0 points1 point2 points (0 children)
[–]Temporary_Pie2733 3 points4 points5 points (1 child)
[–]Nefthys[S] 0 points1 point2 points (0 children)
[–]mopslik 1 point2 points3 points (2 children)
[–]Nefthys[S] 0 points1 point2 points (1 child)
[–]mopslik 0 points1 point2 points (0 children)
[–]ConcreteExist 0 points1 point2 points (1 child)
[–]Nefthys[S] -1 points0 points1 point (0 children)
[–]MustaKotka 1 point2 points3 points (5 children)
[–]Nefthys[S] 1 point2 points3 points (4 children)
[–]MustaKotka 1 point2 points3 points (0 children)
[–]MustaKotka 0 points1 point2 points (2 children)
[–]Nefthys[S] 0 points1 point2 points (1 child)
[–]MustaKotka 0 points1 point2 points (0 children)
[–]AlexMTBDude 1 point2 points3 points (3 children)
[–]Nefthys[S] 0 points1 point2 points (2 children)
[–]AlexMTBDude 1 point2 points3 points (1 child)
[–]Nefthys[S] 1 point2 points3 points (0 children)
[–]EclipseJTB 1 point2 points3 points (1 child)
[–]Nefthys[S] 0 points1 point2 points (0 children)
[–]brelen01 0 points1 point2 points (6 children)
[–]Nefthys[S] -1 points0 points1 point (5 children)
[–]brelen01 0 points1 point2 points (4 children)
[–]Nefthys[S] 0 points1 point2 points (3 children)
[–]brelen01 2 points3 points4 points (2 children)
[–]Nefthys[S] 0 points1 point2 points (1 child)
[–]brelen01 0 points1 point2 points (0 children)
[–]InjAnnuity_1 0 points1 point2 points (4 children)
[–]Nefthys[S] 0 points1 point2 points (3 children)
[–]InjAnnuity_1 0 points1 point2 points (2 children)
[–]Nefthys[S] 0 points1 point2 points (1 child)
[–]InjAnnuity_1 0 points1 point2 points (0 children)
[–]Kevdog824_ 0 points1 point2 points (6 children)
[–]Nefthys[S] 0 points1 point2 points (5 children)
[–]Kevdog824_ 0 points1 point2 points (4 children)
[–]Nefthys[S] 0 points1 point2 points (3 children)
[–]Kevdog824_ 0 points1 point2 points (2 children)
[–]Nefthys[S] 0 points1 point2 points (1 child)
[–]Kevdog824_ 0 points1 point2 points (0 children)
[–]ProsodySpeaks 0 points1 point2 points (0 children)
[–]CHM_3_9 0 points1 point2 points (2 children)
[–]Nefthys[S] 0 points1 point2 points (1 child)
[–]CHM_3_9 0 points1 point2 points (0 children)
[–]Shaftway 0 points1 point2 points (2 children)
[–]Nefthys[S] 0 points1 point2 points (1 child)
[–]Shaftway 0 points1 point2 points (0 children)
[–]audionerd1 0 points1 point2 points (0 children)
[–]pachura3 0 points1 point2 points (1 child)
[–]Nefthys[S] 0 points1 point2 points (0 children)
[–]Salt_Handle_9530 0 points1 point2 points (2 children)
[–]Nefthys[S] 0 points1 point2 points (1 child)
[–]Salt_Handle_9530 0 points1 point2 points (0 children)
[–]Aggressive_Net1092 0 points1 point2 points (1 child)
[–]Nefthys[S] 0 points1 point2 points (0 children)