@wbarnes05 said:
I noticed the change regarding the Length class a few days ago in the API. What's weird is that the API states that the parent of Length is Object starting in SU 2015. That had me worried as it implies that mathematical operations will no longer work on an instance of Length. However everything continued to work ok in my plugin when running in SU 2015.
I ran a few tests in 2015 and found the following:
length = 4.to_l
> 4"
> length.is_a? Integer
> false
> length.is_a? Float
> true
> length.is_a? Length
> true
> length.class.superclass
> Numeric
> length.class.ancestors
> [Length, Numeric, Comparable, Object, Kernel, BasicObject]
It would appear then that the API is incorrect and should be changed to show that Numeric is the parent class.
The API docs needs updating in general to make the hierarchy more clear. There are many inconsistencies. We have a big todo item to improve the whole developer site. Stay tuned.
@wbarnes05 said:
That had me worried as it implies that mathematical operations will no longer work on an instance of Length. However everything continued to work ok in my plugin when running in SU 2015.
We had to pull some tricky shimming to prevent breaking stuff. I wasn't able to do a 100% compatibility, but I think we have a near 99% use case coverage. Main one is C Extensions doing low level type checks for Floats which used to work, but not any more.