Python Worst Practices
MRAB
python at mrabarnett.plus.com
Wed Feb 25 18:34:29 EST 2015
On 2015-02-25 22:59, Joel Goldstick wrote:
> On Wed, Feb 25, 2015 at 4:28 PM, MRAB <python at mrabarnett.plus.com> wrote:
> > On 2015-02-25 20:45, Mark Lawrence wrote:
> >>
> >> http://www.slideshare.net/pydanny/python-worst-practices
> >>
> >> Any that should be added to this list? Any that be removed as not
that
> >> bad?
> >>
> > We don't have numeric ZIP codes in the UK, but the entire world has
> > numeric telephone numbers, so that might be a better example of numbers
> > that aren't really numbers.
>
> US zip codes get messed up with ints because many have a leading zero.
> I use strings
Telephone numbers can also start with zero.
> >
> > Numeric dates can be ambiguous: dd/mm/yyyy or mm/dd/yyyy? The ISO
> > standard is clearer: yyyy-mm-dd.
> >
> > Handling text: "Unicode sandwich".
> >
> > UTF-8 is better than legacy encodings.
> >
More information about the Python-list
mailing list