I don't think we came to any conclusion about this, and I cannot find it in
github, and I cannot access trac...

How should I use contants like ProgrammingError without incurring warnings from
pylint ?  Should I import _pg instead ?

pryzbyj@pryzbyj:/tmp$ cat py

import pg
pg.ProgrammingError

pryzbyj@pryzbyj:/tmp$ pylint -E py
Using config file /home/pryzbyj/.pylintrc
************* Module tmp.py
E:  3, 0: Module 'pg' has no 'ProgrammingError' member (no-member)


On Mon, Aug 19, 2019 at 11:07:17PM -0500, Justin Pryzby wrote:
> Also ... if it's what's easy, I'd be in favour of simply telling people to
> "import _pg" for the LO constants and exceptions.
> 
> On Tue, Aug 13, 2019 at 10:19:22AM -0500, Justin Pryzby wrote:
> > Sorry, this was lost in my spam for three weeks..
> > 
> > On Fri, Jul 26, 2019 at 10:42:14AM +0200, Christoph Zwerschke wrote:
> > > Am 26.07.2019 um 05:20 schrieb Justin Pryzby:
> > > 
> > > > Is there any way to avoid output like this?
> > > >
> > > > ************* Module telsasoft.db
> > > > E: 15, 0: No name 'ProgrammingError' in module 'pg' (no-name-in-module)
> > > > ...
> > > >
> > > > I assume it's related to this:
> > > >
> > > > |    def __getattr__(self, name):
> > > > |        # All undefined members are same as in underlying connection:
> > > > |        if self.db:
> > > > |            return getattr(self.db, name)
> > > > |        else:
> > > > |            raise _int_error('Connection is not valid')
> > > 
> > > The errors complain about not existing members of the module, but the code
> > > above gets members of the connection, not of the module.
> > 
> > Yes, you're right.
> > 
> > > Also, these look like linter errors to me, not runtime errors.
> > 
> > Yes, I'm trying to make at least our most important modules pylint clean.
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo/pygresql

Reply via email to