Python
8
Вклад в тег
items = [1, 2, 3, 4]
def get_item_as_method():
return items.__getitem__(1)
def get_item_as_operator():
return items[1]
LOAD_GLOBAL 0 (items)
LOAD_ATTR 1 (__getitem__)
LOAD_CONST 1 (1)
CALL_FUNCTION 1 (1 positional, 0 keyword pair)
RETURN_VALUE
LOAD_GLOBAL 0 (items)
LOAD_CONST 1 (1)
BINARY_SUBSCR
RETURN_VALUE
is_voted = user in question.voted_users.all()
is_voted = question.voted_users.filter(pk=user.pk).exists()
voted = request.POST['choice']
voted_choice = get_object_or_404(Choice, pk=voted)
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm
pyenv install 3.4.2 # установить версию 3.4.2
pyenv virtualenv 3.4.2 <name_of_venv>