[PonyORM-list] pylint
Vincent LE GOFF
vincent.legoff.srs at gmail.com
Tue Aug 25 16:08:35 UTC 2015
Hi,
I don't know if it's any better by now but pylint used to be a bit weird
sometimes, given syntax it doesn't understand. Pylint does a lot of
things that, in my opinion, it shouldn't, but I believe everything can
be configured. In this context, it simply complains that at your last
line, 'MyClass(field1='aaa')', there's no 'field1' in the constructor.
Which is basically false, because Pony's entity is constructed this way
(probably with a **kwargs in the method definition).
I may be wrong, but I think you can ask Pylint to not check that kind of
things. It gave you the specific error (probably the error number
too). I believe there's a way to configure pylint to ignore that error
and check nevertheless. But I have no idea how to do that.
Hope that helps, even a little,
Vincent
Le 8/25/2015 8:28 AM, Аня Свалова a écrit :
>
> Hi,
> I decided to check my
> project
> via pylint, but this
> check
> failed with error "Unexpected keyword argument 'field1' in constructor
> call (unexpected-keyword-arg)". What should I do to
> do to fix this error?
> ?
>
> In t
> he test project two files: __init __.
> py
> and test.p
> y
> .
>
> test.p
>
> y
>
>
> # coding: utf-8
>
> from pony.orm import sql_debug, db_session, Database, Required
>
> db = Database()
>
>
> class MyClass(db.Entity):
> field1=Required(unicode)
>
>
> db.bind('sqlite', '/tmp/dns11.sqlite', create_db=True)
> db.generate_mapping(create_tables=True)
>
> with db_session:
> MyClass(field1='aaa')
>
>
>
> Regards,
> Anna.
>
>
> _______________________________________________
> ponyorm-list mailing list
> ponyorm-list at ponyorm.com
> /ponyorm-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </ponyorm-list/attachments/20150825/f43457dd/attachment.html>
More information about the ponyorm-list
mailing list