A
A
Andrew2017-10-27 23:56:49
Python
Andrew, 2017-10-27 23:56:49

When does a class return an object when it is created?

When does a class return an object when it is created?
as soon as we define a class through the new operator, the memory for the object is allocated, the constructor is called, and the constructor already returns the object? or is it returned later after methods are added to the object?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Yakushenko, 2019-07-31
@Bergis

import json

data = {"query": "...", "variables": "..."}
headers = {
    "Accept": "application/json",
    "Content-Type": "application/json"
}
response = requests.post(url, data=json.dumps(data), headers=headers)

Specify all the parameters that are in Requests Headers and Requests Payload. And are you sure that you need the post? Maybe try requests.get()?

S
Stalker_RED, 2017-10-28
@Stalker_RED

When it is completely ready, with methods. Although it would be better if you specified what language you are talking about, otherwise you never know, maybe there is some kind of exotic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question