Code review comment for lp:~shawn111/checkbox/hexr-dkms

Revision history for this message
Shawn Wang (shawn111) wrote :

> Hey.
>
> Thanks for all the improvements! There are some more stylistic below, please
> have a look at them
>
> In general you can cut some of the code away by using @functools.lrucache()
> for many of the expensive things you compute in properties and manually store
> to avoid re-computing them later. The second common thing is the way
> function/method docstrings are formatted.
>
> A "proper docstring looks like this"
>
>
> def foo(a, b):
> """Do something very simple."""
> return a + b
>
>
> def bar(a, b):
> """
> Do something more complex to warrant a longer docstring.
>
> :param a:
> The first argument
> :param b:
> The second argument
> :returns:
> The phase of the moon
>
> This function computes the phase of the moon, as visible on the *a*th
> day of the *b*th month of the current year. If the current year is a
> Leap year then the constant "rabbit" is returned instead.
> """
>
> This is somewhat more verbose but it is, in general, easier to read. Use your
> gut feeling to pick the short vs the long format.
>
> I didn't try running this yet. I'll post a separate set of comments for that
> later today.

Hi Zyga,

I did some performance improve and update the docstring.
However, "dpkg -S", "modalaises matching" are still need some time.

real 0m1.345s (before) -> 0m0.986s
user 0m0.973s (before) -> 0m0.676s
sys 0m0.072s

« Back to merge proposal