Hybrid Property documentation example Does Interval Intersect Wrong

Issue #3528 resolved
Jason Myers created an issue

I don't know if we even care to fix this or maybe just rename it from intersect to contains range; however, the docs at https://bitbucket.org/zzzeek/sqlalchemy/src/be548690c7053a25a546d47cc4ae6e3595c6f421/lib/sqlalchemy/ext/hybrid.py?at=master&fileviewer=file-view-default#hybrid.py-52 would fail for an example of

Interval(3, 5).intersects(Interval(2, 5))

Although those intervals do intersect. I'm happy to fix this, just let me know if you would like to just rename intersects or if you want intersects to work for these cases.

Comments (6)

  1. Mike Bayer repo owner

    hi Jason -

    I'm not sure where I got that logic from, perhaps I just came up with it on the fly, as I was only concerned with illustrating, "here's how to make a hybrid method" - if we can fix the intersect() function to work correctly, assuming it doesn't make the code so dense that it no longer illustrates the original point, that would be great.

    • mike
  2. Log in to comment