gabu

BARK BARK BARK!!! am dog!

samoyed taur / 32 / ΘΔ
i stream on twitch!! (sometimes???)

 

woof woof woof

 

fursuit head by AlphaDogs

pfp by BeetleYeen


🐕 mastodon
chitter.xyz/@gabu

for some reason. its impossible to get anything relevant because all the answers i can find are for people who have Literally The Dumbest Problem and not my problem. anyway

hey so i'm adding pylint to an old project at work and its complaining about names like

C0103: Variable name "SomeCoolClass" doesn't conform to snake_case naming style (invalid-name)

obviously i can either rename the variable or add a comment disabling that error but i would like to conceptually fix it if possible... the thing is that this variable is not a variable but its a class definition returned by a method at runtime (inside another method), ex

def what():
    SomeCoolClass = give_me_the_class()
    a_thing = SomeCoolClass.create_a_thing()

now in this particular case i can put the give_me_the_class line at the top level and it doesn't complain but there's also places where that's not possible because it might not be registered at import time. anyway it's about a conceptual problem here: assume that the class getter can't be generated at import time, it's like dynamically generated by the method.

i also think it would be even worse to rename that class name to a snake case variable name because then it would look more like a class instance rather than a class definition to the passing eye and could easily cause mistakes.

is there really no solution except to disable that warning on that line? i've even tried things like adding type annotations to make it clear that its a class type, but i think pylint doesn't look at those?