[PATCH 8 of 9] pycompat: put single line things above class and function definitions

Pulkit Goyal 7895pulkit at gmail.com
Sat Jun 17 04:52:57 EDT 2017


On Fri, Jun 16, 2017 at 7:51 PM, Yuya Nishihara <yuya at tcha.org> wrote:
> On Fri, 16 Jun 2017 03:04:50 +0530, Pulkit Goyal wrote:
>> # HG changeset patch
>> # User Pulkit Goyal <7895pulkit at gmail.com>
>> # Date 1497561930 -19800
>> #      Fri Jun 16 02:55:30 2017 +0530
>> # Node ID c95d3227e37cfbbb2c687dad98bc978d063c624f
>> # Parent  66940f7bf570ebb3a3a43c556e6887dab28c19a4
>> pycompat: put single line things above class and function definitions
>>
>> Earlier, there are some single line assignments initially then a function, then
>> some more single line assignments, then again few functions. This patch gathers
>> all those single line assignments at one place and make sure functions are
>> continuous so that it's easy to read code. Therefore it also moves the wrapper
>> above the bytestr class.
>
> Maybe we've been using different algorithms to sort stuffs in pycompat.py.
> I tried to keep py2 and py3 functions in the same order. I'm okay for this
> change, but can you adjust the sorting methodology a bit so that related
> functions won't be orphaned?

I was just using linear scan to look for functions and hence decided
to adjust them as given in the patch. But I like your idea of keeping
them in same order, so let's keep this as it is.


More information about the Mercurial-devel mailing list