News for hackers. Stuff that matters.
Re:Pendulum – Python datetimes made easy by bjt on Tuesday August 16, 2016 @09:52PM (#12301988)
1.day? I confess to not being a Rubyist, but does that require monkeypatching the base int class?

I don't see anything unreasonable about Pendulum's interface. Let's let Python be Python and Ruby be Ruby.

Re:Pendulum – Python datetimes made easy by dasil003 on Wednesday August 17, 2016 @02:34AM (#12302865)
I am a rubyist for over a decade now, and while I don't have a problem with the monkeypatching per se, I don't think anyone should be holding up ActiveSupport's time zone support as a paragon of good API design. Yes, on the surface it looks pretty nice, but because of the weird mix of different classes and extensions you get a frankenstein API that is a very leaky abstraction. I could dig up a raft of examples, but just off the top of my head... Date.today respects the global setting of Time.zone, but Date.yesterday always gives you the UTC date. The inconsistencies and permutations of Date, DateTime, Time, and TimeWithZone, combined with machine clock, Time.zone global, and UTC lead to so much confusion that the only way to ensure correctness is to declare a subset of the API which you always use, and reject everything else just so your team gets used to reasoning about it.

Sorry for the rant, but I've spent many years as the only California developer for a time based in the UK, suffering the tyranny of developers who spend half their year blissfully living in UTC and unknowingly foisting off their dirty time zone bugs on me.

Re:Pendulum – Python datetimes made easy by tedmiston on Wednesday August 17, 2016 @12:22AM (#12302494)
Similar idea to Ruby's .times() method [0].

[0]: http://ruby-doc.org/core-1.9.3/Integer.html#method-i-times

Re:Pendulum – Python datetimes made easy by teej on Tuesday August 16, 2016 @10:41PM (#12302159)
Well, for a long time, letting "Python be Python" required dealing with absolutely terrible time zone support. As an example, Python's strptime only got timezone support (in %z) in version 3.2 in 2011.
Re:Pendulum – Python datetimes made easy by Niksko on Tuesday August 16, 2016 @10:10PM (#12302045)
No, don't think so. I think this is a native syntax construct in Ruby.
Re:Pendulum – Python datetimes made easy by teej on Tuesday August 16, 2016 @10:47PM (#12302184)
1.day is not a native Ruby concept, it is a method monkeypatched into the Numeric class by Rails' ActiveSupport. See http://api.rubyonrails.org/classes/Numeric.html#method-i-day and https://ruby-doc.org/core-2.2.0/Numeric.html.
Re:Pendulum – Python datetimes made easy by twblalock on Wednesday August 17, 2016 @02:29AM (#12302855)
I can see how people think it is native Ruby. Very few people use Ruby without Rails.