Constant naming convention

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Dec 13 11:29:02 EST 2016



On 12/12/2016 04:12 PM, 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.

As much as there is many thing in our current coding still, it is our 
current coding style and our codebase is consistent with it for the very 
vast majority. As stated previously, my current stance is that we should 
refrain for changing this category for policy for about one year after 
Matt stepped away. So I would like us to keep to lower case constants 
for now.
At the 4.4 sprint, I'll be very happy to have a large discussion about 
our style (and very happy to us CAPS for constant at that time).

Cheers,

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list