3 ms·
from io import reader reader = reader.Reader() reader.read(file) Isn't this why you can say: from io import reader as r And then: reader =
by YeGoblynQueenne 7y ago
from io import reader
reader = reader.Reader()
reader.read(file)
Isn't this why you can say:
from io import reader as r
And then:
reader = r.Reader()
reader.read(file)
?
- joshuamorton 7y agoSure but you still have `read` 4 times (down from 6), while I have it only once. And that comes at the cost of forcing your users to alias a variable which can be a maintenance burden long term.
- YeGoblynQueenne 7y agoFair enough. Though two of the "read" are "reader" and "Reader" and you can tell them apart easily from the capitalisation. But I don't completely disagree with your point.