SublimeCodeIntel / CodeIntel

Full-featured code intelligence and smart autocomplete engine
http://www.sublimecodeintel.com
Other
42 stars 8 forks source link

Python - class method args first one not printed #2

Closed xmsid closed 6 years ago

xmsid commented 7 years ago

when i use python and make a class without the () and without putting a "self" arg in every func example: class common: def HulloWorld(arg1,arg2,arg3): print('Hullo World!') and when i import the module it gives me the args like this Utilities.common.HulloWorld(arg2,arg3) it expects a "self" arg and removes the first arg. i think that's pretty easy to solve :)

Kronuz commented 6 years ago

Instance method’s first argument always represents “self”. Class medod’s first argument always represents ”cls” and must be decorated with @classmethod Static method doesn’t have a “magic” first argument and must be decorated with @staticmethod

Your example is showing a regular instance method.

xmsid commented 6 years ago

@Kronuz so should i use

@staticmethod

? is my way of declaration wrong?

xmsid commented 6 years ago

i just re-readed the python doc, my way of declaration is wrong, Thanks. close the issue