4 ms·
Yes, I know. That doesn’t redeem it. I want never to have to read those names in python code I'm working with; the documentation entry doesn't achieve that. An
by da39a3ee 5y ago
Yes, I know. That doesn’t redeem it. I want never to have to read those names in python code I'm working with; the documentation entry doesn't achieve that.
And anyway, the library is called “attrs”, so why is it imported as “attr”?
- KptMarchewa 5y ago>And anyway, the library is called “attrs”, so why is it imported as “attr”? Python packaging is terrible, and giving package authors footguns like this. It's possible that it would be imported as "da39a3ee".
- da39a3ee 5y ago"attr" is the choice of the library designers. The question is why did they choose that name when users will expect it to be imported as "attrs"? Clearly if they had chosen "da39a3ee" we wouldn't need to discuss whether they had good judgement.
- nerdponx 5y agoThe package can contain entirely arbitrary module names. Any similarity in naming is by convention only. Don't quote me on this, but I don't see why two different packages can't contain the same module name and overwrite each other.
- HelloNurse 5y agoIf it is a problem, import attr as attrs which is probably what I would do for consistency.
- da39a3ee 5y agoI want never to see the names attr.ib and attr.s in code that I am working on. So I don't understand how your suggestion solves the problem: it might not be me writing the code.
- stavros 5y agoI never want to see Javascript code either, but being annoyed at Brendan Eich all the time is a bit futile.