Constant naming convention (was: Re: [PATCH 1 of 7 upgraderepo V2] revlog: add clone method)

Yuya Nishihara yuya at tcha.org
Tue Dec 13 08:54:24 EST 2016


On Mon, 12 Dec 2016 10:12:48 -0500, Augie Fackler wrote:
> On Mon, Dec 12, 2016 at 11:04:07AM +0100, Pierre-Yves David wrote:
> >
> >
> > On 11/25/2016 04:28 AM, Gregory Szorc wrote:
> > >diff --git a/mercurial/revlog.py b/mercurial/revlog.py
> > >--- a/mercurial/revlog.py
> > >+++ b/mercurial/revlog.py
> > >@@ -1818,3 +1818,95 @@ class revlog(object):
> > >         if not self._inline:
> > >             res.append(self.datafile)
> > >         return res
> > >+
> > >+    DELTAREUSEALWAYS = 'always'
> > >+    DELTAREUSESAMEREVS = 'samerevs'
> > >+    DELTAREUSENEVER = 'never'
> >
> > We don't use cap in our names, even for constant, these should be lower
> > case.
> 
> Can we just align with prevailing Python style here and start using
> all caps for constants? This comes up roughly monthly, and I think
> it'd be a good clarity win.

I'm fine with ALLCAPS constants.


More information about the Mercurial-devel mailing list