All of lore.kernel.org
 help / color / mirror / Atom feed
From: Seth Forshee <seth.forshee@canonical.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Haim Dreyfuss <haim.dreyfuss@intel.com>,
	linux-wireless@vger.kernel.org,
	wireless-regdb@lists.infradead.org
Subject: Re: [wireless-regdb] [PATCH 2/2] wireless-regdb: Parse wmm rule data
Date: Wed, 2 May 2018 07:32:36 -0500	[thread overview]
Message-ID: <20180502123236.GA981@ubuntu-xps13> (raw)
In-Reply-To: <1525209561.25505.3.camel@sipsolutions.net>

On Tue, May 01, 2018 at 11:19:21PM +0200, Johannes Berg wrote:
> On Tue, 2018-05-01 at 15:02 -0500, Seth Forshee wrote:
> > 
> > > +import attr
> > 
> > I'm a little hesitant to add use of non-standard libraries if it isn't
> > necessary, as some distros have traditionally built the regdb from
> > source (not sure how practical that is after the db-as-firmware changes
> > though). Do we lose anything critical if we don't use attr?
> 
> I probably suggested the use of attr. It's super useful, for things like
> this:
> 
> > > +@attr.s(frozen=True)
> > > +class WmmRule(object):
> > > +    vo_c = attr.ib()
> > > +    vi_c = attr.ib()
> > > +    be_c = attr.ib()
> > > +    bk_c = attr.ib()
> > > +    vo_ap = attr.ib()
> > > +    vi_ap = attr.ib()
> > > +    be_ap = attr.ib()
> > > +    bk_ap = attr.ib()
> > > +
> > > +    def _as_tuple(self):
> > > +        return (self.vo_c, self.vi_c, self.be_c, self.bk_c,
> > > +                self.vo_ap, self.vi_ap, self.be_ap, self.bk_ap)
> 
> Spelling this out as a real object with all the __repr__ and comparisons
> etc. gets far more verbose.
> 
> While we can get rid of it in theory, it's a ~100KiB package without any
> further dependencies, and the code is better off for it.
> 
> Ultimately it's your decision, but I suspect that python is already such
> a big dependency that adding this library is in the noise.

I'm more thinking that for e.g. Debian if attr is installed via pip and
not a distro package then that might be a problem for their package
builds. But let's go ahead and leave it, if there's fallout we can
figure that out later.

Thanks,
Seth

WARNING: multiple messages have this Message-ID (diff)
From: Seth Forshee <seth.forshee@canonical.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org,
	Haim Dreyfuss <haim.dreyfuss@intel.com>,
	wireless-regdb@lists.infradead.org
Subject: Re: [wireless-regdb] [PATCH 2/2] wireless-regdb: Parse wmm rule data
Date: Wed, 2 May 2018 07:32:36 -0500	[thread overview]
Message-ID: <20180502123236.GA981@ubuntu-xps13> (raw)
In-Reply-To: <1525209561.25505.3.camel@sipsolutions.net>

On Tue, May 01, 2018 at 11:19:21PM +0200, Johannes Berg wrote:
> On Tue, 2018-05-01 at 15:02 -0500, Seth Forshee wrote:
> > 
> > > +import attr
> > 
> > I'm a little hesitant to add use of non-standard libraries if it isn't
> > necessary, as some distros have traditionally built the regdb from
> > source (not sure how practical that is after the db-as-firmware changes
> > though). Do we lose anything critical if we don't use attr?
> 
> I probably suggested the use of attr. It's super useful, for things like
> this:
> 
> > > +@attr.s(frozen=True)
> > > +class WmmRule(object):
> > > +    vo_c = attr.ib()
> > > +    vi_c = attr.ib()
> > > +    be_c = attr.ib()
> > > +    bk_c = attr.ib()
> > > +    vo_ap = attr.ib()
> > > +    vi_ap = attr.ib()
> > > +    be_ap = attr.ib()
> > > +    bk_ap = attr.ib()
> > > +
> > > +    def _as_tuple(self):
> > > +        return (self.vo_c, self.vi_c, self.be_c, self.bk_c,
> > > +                self.vo_ap, self.vi_ap, self.be_ap, self.bk_ap)
> 
> Spelling this out as a real object with all the __repr__ and comparisons
> etc. gets far more verbose.
> 
> While we can get rid of it in theory, it's a ~100KiB package without any
> further dependencies, and the code is better off for it.
> 
> Ultimately it's your decision, but I suspect that python is already such
> a big dependency that adding this library is in the noise.

I'm more thinking that for e.g. Debian if attr is installed via pip and
not a distro package then that might be a problem for their package
builds. But let's go ahead and leave it, if there's fallout we can
figure that out later.

Thanks,
Seth

_______________________________________________
wireless-regdb mailing list
wireless-regdb@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/wireless-regdb


  reply	other threads:[~2018-05-02 12:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-01 13:36 [PATCH 1/2] wireless-regdb: Add wmm rule for EEA and EFTA countries Haim Dreyfuss
2018-05-01 13:36 ` [wireless-regdb] " Haim Dreyfuss
2018-05-01 13:36 ` [PATCH 2/2] wireless-regdb: Parse wmm rule data Haim Dreyfuss
2018-05-01 13:36   ` [wireless-regdb] " Haim Dreyfuss
2018-05-01 20:02   ` Seth Forshee
2018-05-01 20:02     ` [wireless-regdb] " Seth Forshee
2018-05-01 21:19     ` Johannes Berg
2018-05-01 21:19       ` Johannes Berg
2018-05-02 12:32       ` Seth Forshee [this message]
2018-05-02 12:32         ` Seth Forshee
2018-05-02 12:37         ` Johannes Berg
2018-05-02 12:37           ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180502123236.GA981@ubuntu-xps13 \
    --to=seth.forshee@canonical.com \
    --cc=haim.dreyfuss@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=wireless-regdb@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.