Code review comment for lp://qastaging/~justin-fathomdb/nova/strongly-typed-image-model

Revision history for this message
justinsb (justin-fathomdb) wrote :

Thanks for the meta - I wish we could comment directly on the code as well,
but it's still a lot closer than the alternatives.

Definitely this is not a completed work.. there's a lot of messiness in the
commented out code which I'm hoping to remove entirely! And it definitely
needs a rebase, or else I think vish will kill me if this somehow ends up
landing first!

I don't particularly like the PyLint hacks. I don't mind type-checking the
> incoming parameter so much as I mind returning after a raise. Is there no
> way to give pylint inference hints in comments?

I quite like type-checking the incoming parameter as I think it makes the
code more understandable, but I'm an old school static-typist at heart!

I agree that the hack is fugly, but I haven't yet found an alternative (and
I did look!)... I'm hoping somebody will chime in with "you just write
@returnType(Image), dummy!" or something like that :-)

It is possible to hide the hack in a shared "checked_cast(o, cls)" function,
so the monstrosity could only appear once, but hopefully we can get that
down to 0 somehow.

« Back to merge proposal