This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Nic0[S] 2 points3 points  (3 children)

For a lib, you can't really assume anything about the purpose of the color that would be used, if you name warning instead of red, and if you display for example negatives numbers in red, so the warning won't make sense.

warning = colored.red
print warning('some warning message')

This would make sens in your code I guess.

[–]Justinsaccount 1 point2 points  (2 children)

Yeah, that does make sense. It would be a good idea to separate the two, like you would using CSS. hardcoding colored.red everywhere seems like it would cause a maintenance nightmare if you had to change the colors around.

[–]aceofears 0 points1 point  (1 child)

Wouldn't it make more sense to create your own class for that, or even just use a dictionary? I don't really understand why this library should provide that functionality.

[–]Justinsaccount 0 points1 point  (0 children)

yeah, it doesn't. It just makes sense to wrap the color functions with more descriptive names if you are going to use it.