pylint - data.Transaction is not callable

44 views
Skip to first unread message

Sam Bragg

unread,
Oct 17, 2020, 3:40:54 PM10/17/20
to Beancount
Working with the utrade example, pylint tells me data.Transaction is not callable

Snippet from my code:

from beancount.core import data

data.Transaction(...)

If it matters, I am using VSCode and pipenv to manage venvs.

Ondřej Švec

unread,
Oct 18, 2020, 10:18:30 AM10/18/20
to Beancount
I have the same problem. I am running Beancount on WSL. Everything installed using pip3 install.
Beancount 2.3.2
Python 3.8.2
Pylint 2.6.0

from beancount.core.data import Transaction
Transaction() <- Transaction is not callable (py-lint(not-callable). Transaction: NamedTuple

However, running bean-extract works like charm, so it's just annoying during development.

Daniele Nicolodi

unread,
Oct 18, 2020, 10:35:06 AM10/18/20
to bean...@googlegroups.com
On 18/10/2020 16:18, Ondřej Švec wrote:
> I have the same problem. I am running Beancount on WSL. Everything
> installed using pip3 install.
> Beancount 2.3.2
> Python 3.8.2
> Pylint 2.6.0
>
> from beancount.core.data import Transaction
> Transaction() <- Transaction is not callable (py-lint(not-callable).
> Transaction: NamedTuple
>
> However, running bean-extract works like charm, so it's just annoying
> during development.

Please report the bug to the pylint developers. Evidently pylint does
not grok enough of Python to understand that Transaction is a class.

Cheers,
Dan

Martin Blais

unread,
Oct 18, 2020, 3:26:09 PM10/18/20
to Beancount
I think the problem is that pylint doesn't grok NamedTuple, but it does collections.namedtuple.
The problem is pylint.


--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/d5047dec-7fed-487e-bffe-ce70cb8fb835n%40googlegroups.com.

Martin Blais

unread,
Oct 18, 2020, 3:27:12 PM10/18/20
to Martin Blais, Beancount
I don't see the warning.
Upgrade your version (pylint is always in motion).

Reply all
Reply to author
Forward
0 new messages