class Query:
def __init__(self, stack):
self.arr = stack
def __add__(self, query):
self.arr.extend(query.arr)
return self
def __str__(self):
return f"[ {' -> '.join([str(x) for x in self.arr])} ]"
qr_1 = Query([1, 2, 3])
qr_2 = qr_1
print(id(qr_1), id(qr_2))
qr_1 = qr_1 + Query([10, 12])
print(id(qr_1), id(qr_2))
print(qr_1) # [1 -> 2 -> 3 -> 10 -> 12]
print(qr_2) # [1 -> 2 -> 3]
1964106270472 1964106270472
1964106270472 1964106270472
[ 1 -> 2 -> 3 -> 10 -> 12 ]
[ 1 -> 2 -> 3 -> 10 -> 12 ]
import requests
data = {'j_username': 'login', 'j_password': '123'}
with requests.Session() as session:
session.post(url, json=data)