What's the neatest way of getting dictionary entries in a specified order?

Chris Green cl at isbd.net
Thu Mar 9 08:03:54 EST 2017


Chris Angelico <rosuav at gmail.com> wrote:
> On Thu, Mar 9, 2017 at 8:25 AM, Chris Green <cl at isbd.net> wrote:
> > Chris Angelico <rosuav at gmail.com> wrote:
> >> On Thu, Mar 9, 2017 at 6:27 AM, Chris Green <cl at isbd.net> wrote:
> >> >     dbcol['firstname'] = col('First Name', True, False)
> >> >     dbcol['lastname'] = col('Last Name', True, False)
> >>
> >> http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/
> >>
> > Yes, I'm well aware of these issues, but it's my personal address book
> > so I can avoid many/most of them.
> 
> So you assume that you'll never meet someone from another culture?
> Okay. I'm pretty sure that counts as bigoted, but sure :)
> 
> As a general rule, it's safest to just have a single "name" field and
> have done with it.
> 
Which doesn't work at all for me as I want to:-

    Sort on family/last name
    Separate first and family name so I can write addresses etc.

I've lived in quite a few different places where names are not
formatted like ours.  I'm aiming to add 'nameprefix' and 'namesuffix'
fields to handle different formats more completely, the layout I
showed here is just a prototype.

-- 
Chris Green
·



More information about the Python-list mailing list