On 2020-03-19 14:24:35 +0000, Rhodri James wrote: > On 19/03/2020 13:00, Peter J. Holzer wrote: > > It's more compact, especially, if "d" isn't a one-character variable, > > but an expression: > > > > fname, lname = db[people].employee.object.get(pk=1234)[['first_name', > > 'last_name']] > > > > vs. > > > > fname = db[people].employee.object.get(pk=1234)['first_name'] > > lname = db[people].employee.object.get(pk=1234)['last_name'] > > I have to say I don't think that's more compact at all. It's too wide > to be compact.
But 83 characters is still more compact than 121 characters. hp -- _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | h...@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!"
signature.asc
Description: PGP signature
-- https://mail.python.org/mailman/listinfo/python-list