Skip to content

refactor(Functors): remove __doc__ hack, no longer needed in py >= 3.9

Christoph Hasse requested to merge chasse_rm_doc_hack into master

Related to #201 (closed) (cc @roneil)

Judging from the date, the issue above was from when we were still on LCG_97a and thus using python 2.7.
But those times are long gone, and we are now happily enjoying python >= 3.9.

In this brave new world, pydoc.help invoked on an class instance ends up calling _getowndoc

This means that if we have an instance of BoundFunctor, for example Functors.PT which has __doc__ = "Transverse Momentum" we can call help(Functors.PT) and get:

Help on BoundFunctor in module Functors.grammar:

('::Functors::Track::TransverseMomentum{}', ['Functors/TrackLike.h'], 'PT')
    Transverse momentum.

This also makes the Moore doc cleaner, as it gets rid of the many times duplicated Note about explicitly checking __doc__

Picture time, before:
image

and after 😍
image

cc @mvesteri @poluekt

Merge request reports