6 ms·
That sounds logical enough, except for two things: First: You are often working with someone-else's library which for various reasons you cannot change. Secon
by teilo 16y ago
That sounds logical enough, except for two things:
First: You are often working with someone-else's library which for various reasons you cannot change.
Second: It is not uncommon to use a standard method that may well be able to return multiple items, but in your use case it should only return one. Case in point: a database call that returns the result of a query.
- baddox 16y agoDjango's ORM, the only Python one I've experience with, provides get() for those cases.