Static and class methods in editor

Could the editor please not mark static and class methods as errors simply because they don’t have ‘self’ as the first argument?

1 Like

Especially when preceded immediately by an explicit decorator…

This could get in the way of some new folks getting on board with Anvil. They might easily conclude that these standard Python features do not work in Anvil, when in fact, they work quite well.

Especially when preceded immediately by an explicit decorator…

Yep, that’s certainly how we’d do it! It’s a pretty straightforward addition to the autocompleter - just need to find some round tuits :wink:

3 Likes

Pretty please? This threw me off today.

@shaun Did this one make it on to the issue tracker?

1 Like

The fact that python has the self requirement for any methods in the class is obnoxious.

Hi.

This is relatively minor, but rather jarring when you see the warning sign!

When using @clsssmethod decorator, and the first argument to the method is cls and not self the IDE shoots up a warning. As seen below. It would be nice to support class methods (I assume it would be a simple modification of the static methods implementation, perhaps?).

image

Thank you. Anders.

See also Static and class methods in editor

1 Like

Thank you @bridge for merging the posts!

1 Like