On Thu, Oct 20, 2011 at 11:47 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote:
> So, just out of curiosity, how many other people didn't realise you > could do this: > > >>> print '%(language)s has %(number)03d quote types.' % \ > ... {"language": "Python", "number": 2} > > > Instead of this: > > print "%s has %03d" % ( "python", "2" ) > > 6 years of python development, and I never found this little beauty. Fail. > > Hope this helps someone else. > I use a similar thingy for the ORM queries. Named arguments help in good readability, especially in complex queries. -V http://blizzardzblogs.blogspot.com/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.