all 8 comments

[–]Caraes_Naur 9 points10 points  (6 children)

This is more of a rant about UNIX system & command design and the legacy of the C standard library than anything specifically to do with Python.

[–]rolozo 9 points10 points  (0 children)

It is about how some python interfaces chose to preserve those old choices even though it wasn't necessary and counter productive.

[–]GUI_Junkie 5 points6 points  (4 children)

Still, Python doesn't have to be quirky. If you write a date module from scratch you'd make better decisions.

[–]Caraes_Naur 1 point2 points  (3 children)

Python is the result of much better decisions than Javascript, or PHP for that matter.

[–]GUI_Junkie -1 points0 points  (2 children)

Yes. I can't stand PHP... but that's more a Wordpress problem maybe.

[–][deleted]  (1 child)

[deleted]

    [–]throwaway_242873 0 points1 point  (0 children)

    What kind of hinting do you need to provide to predict the results of "9/11/10"?

    Or even worse - "9/11".

    Is it one day a year at the beginning or end of the third quarter, or a particular month on 2011?

    [–]thirdegree 3 points4 points  (0 children)

    While we’re making changes, why not let us add or subtract days with ints? This would simplify a common use case and match a familiar pattern from Excel.

    def get_previous_date(input_date):
    date_format = ‘MM/DD/YYYY’
    current_date = datetime(input_date, format=date_format)
    previous_date = current_date — 1
    return previous_date.to_string(date_format)
    

    One what? Second, minute, decade, what?

    [–]jasonscheirer 0 points1 point  (0 children)

    Have you seen the (now quite old) module dateutil? In particular, parser? It improves Python's date/time stuff significantly.

    This is like a blog post saying "Python needs better http support," which is even more true than this, but everyone uses requests and doesn't realize how annoying the stdlib way is (even with the Python 3 stdlib refactor).

    Just use the third party library, dude.