Typeerror Save Missing 1 Required Positional Argument Self

[Solved] Typeerror Save Missing 1 Required Positional Argument Self | Vb - Code Explorer | yomemimo.com
Question : python missing 1 required positional argument:

Answered by : carlos-santos-pinto

"""
This might pop up if you're trying to use a class directly,
rather than instantiating it. The "missing" argument is "self"
corresponding to the object that you didn't instantiate
"""
class MyClass: def __init__(self, attr) -> None: self.attr = attr def get_attr (self): return self.attr
# CORRECT
object_of_myclass = MyClass(1)
print (type(object_of_myclass)) # <class '__main__.MyClass'>
print (object_of_myclass.get_attr()) # 1
# INCORRECT
myclass = MyClass
print (type(myclass)) # <class 'type'>
print (myclass.get_attr())
# TypeError: get_attr() missing 1 required positional argument: 'self'

Source : | Last Update : Wed, 09 Jun 21

Question : TypeError: save() missing 1 required positional argument: 'self'

Answered by : habib-ur-rehman-q6x0qrjlql27

syntax should be this
user_profile = UserProfile()

Source : https://stackoverflow.com/questions/46907511/typeerror-save-missing-1-required-positional-argument-self | Last Update : Fri, 14 Oct 22

Question : missing 1 required positional argument 'self'

Answered by : annoying-alpaca-h5pwrc34uxvc

p = Pump()
p.getPumps()

Source : https://stackoverflow.com/questions/17534345/typeerror-missing-1-required-positional-argument-self | Last Update : Fri, 23 Sep 22

Answers related to typeerror save missing 1 required positional argument self

Code Explorer Popular Question For Vb