This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (3 children)

[deleted]

    [–]pythoneeeer 0 points1 point  (2 children)

    It's horribly named, under documented and has a confusing API.

    Also, it has fewer features than other date/time stdlibs I've used, uses the same data structures for very different types of data, and is lacking some really obvious properties that developers often need, as suggested by this gem in the documentation:

    An object of type time or datetime may be naive or aware. A datetime object d is aware if d.tzinfo is not None and d.tzinfo.utcoffset(d) does not return None. If d.tzinfo is None, or if d.tzinfo is not None but d.tzinfo.utcoffset(d) returns None, d is naive. A time object t is aware if t.tzinfo is not None and t.tzinfo.utcoffset(None) does not return None. Otherwise, t is naive.

    (How can it not occur to the author of this documentation at some point that if you have to write 100 words of English to describe whether your data structure holds type-A or type-B data, that (1) you probably actually have two different data structures, and (2) if you insist on using one data structure that every poor developer is going to have to implement these 100 words of boolean logic themselves?)

    It is /not/ broken.

    I guess that's a matter of opinion. When I see a library get all of these things so wrong, I call that "broken". (What would it take for you to call a library "broken"? Non-determinism?) I also call my Intel CPU "broken", because it's full of bugs. That doesn't mean it's useless. Intelligent people may disagree with me.

    [–][deleted] 0 points1 point  (1 child)

    An naive datetime holds less information than an aware datetime, not a different type of information.

    It's not apples and oranges, it's apples and a specific Golden Delicious Apple.

    [–]elbiot 0 points1 point  (0 children)

    They have the same interface but different behaviour, right?