DEV Community

Discussion on: Ruby Tutorial for Python Programmers: how to make the switch

Collapse
 
djuber profile image
Daniel Uber

I agree - as a concrete example, ActiveSupport adds days to Numbers (or maybe just to integers) so you can say things like 3.days.ago and get and answer that's the same as Time.now - 72.hours (hours is another patch on numbers to handle the conversion).

I suspect that might just have been a typo? I'm not familiar enough with Python to say if it's just those two columns are transposed. Can you modify/override List's __getitem__ in python to change how element access by offset works?