D5441: rust-cpython: binding for LazyAncestors

Yuya Nishihara yuya at tcha.org
Fri Dec 28 00:42:17 EST 2018


>   > Does the class name actually matter? Personally I don't care if
>   >  lazyancestors() function returns a LazyAncestors object. We'll anyway
>   >  need a wrapper function to make pure ancestors and rustext ancestors
>   >  compatible.
>   
>   Yes, that's in line with your other comments, whereas I was pursuing the
>   goal of putting the whole `ancestor` module under responsibility of
>   `policy.importmod` : in that case, it would have been necessary to have
>   the same name.

I was wondering if it would be possible to export a module attribute in all
lower-caps without renaming the type. (i.e. `lazyancestors = LazyAncestors`.)

Anyway, I just thought using CamelCase in Rust would be slightly nicer and
simpler. If that makes things complicated, I'll drop my idea and stick to
anything that is simpler.

>   I think I still prefer to put all the dispatching in the `revlog` module
>   (ie have it play the factory role) rather than put a factory function
>   inside `ancestor`. Unless you disagree, I'm going to make a new revision
>   going in that direction, ie
>   
>   - the class would be called `LazyAncestors`
>   - the dispatching would stay in `revlog`

Both sound good.

>   - maybe for clarity, `ancestor.rustlazyancestors` should be renamed

I think `rustlazyancestors` will be removed in favor of rust-cpython
implementation.


More information about the Mercurial-devel mailing list