Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

CChheecckk yyoouurr dduupplleexx sswwiittcchh..


devel / comp.lang.python / Re: for convenience

SubjectAuthor
o Re: for convenienceAvi Gross

1
Re: for convenience

<mailman.337.1647899281.2329.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17559&group=comp.lang.python#17559

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: avigr...@verizon.net (Avi Gross)
Newsgroups: comp.lang.python
Subject: Re: for convenience
Date: Mon, 21 Mar 2022 21:47:56 +0000 (UTC)
Lines: 65
Message-ID: <mailman.337.1647899281.2329.python-list@python.org>
References: <A779625E-5D40-410A-83C3-BA73E4108228@paulstgeorge.com>
<CAPTjJmr04OXW4k76Xa_9xd8p93gxzARUZUyUk6ehu-x53m2=ig@mail.gmail.com>
<651952493.752313.1647899276486@mail.yahoo.com>
Reply-To: Avi Gross <avigross@verizon.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de d1Oyre9znDeisePkDArAcwcYq8z4y/yrtgW/anc29OFw==
Return-Path: <avigross@verizon.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=verizon.net header.i=@verizon.net header.b=NiXlsAUh;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.033
X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'this:': 0.03; '2022':
0.05; 'variable': 0.05; 'else.': 0.07; 'mar': 0.07; 'python.':
0.08; 'angelico': 0.09; 'binding': 0.09; 'compiler': 0.09;
'deeper': 0.09; 'implicit': 0.09; 'parse': 0.09; 'question:':
0.09; 'tricks': 0.09; 'url:mailman': 0.15; 'that.': 0.15; 'alias':
0.16; 'chrisa': 0.16; 'interpreter': 0.16; 'kind,': 0.16;
'presumably': 0.16; 'shorter': 0.16; 'structures': 0.16;
'textual': 0.16; 'wrote:': 0.16; 'problem': 0.16; 'python': 0.16;
'name.': 0.19; 'tue,': 0.19; 'to:addr:python-list': 0.20;
'language': 0.21; 'languages': 0.22; 'code': 0.23; 'to:name
:python-list@python.org': 0.24; 'anything': 0.25; 'skip:- 10':
0.25; 'url-ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24':
0.25; 'url:listinfo': 0.25; 'url-ip:188.166/16': 0.25; 'seems':
0.26; 'object': 0.26; 'creating': 0.27; 'local': 0.27; 'old':
0.27; 'chris': 0.28; 'output': 0.28; 'sense': 0.28; 'thinking':
0.28; 'example,': 0.28; 'wrong': 0.28; 'code,': 0.31; 'effect':
0.31; 'url-ip:188/8': 0.31; 'think': 0.32; 'concept': 0.32;
'context': 0.32; 'else,': 0.32; 'happening': 0.32; 'manipulate':
0.32; 'but': 0.32; 'subject:for': 0.33; 'same': 0.34; 'header:In-
Reply-To:1': 0.34; 'meaning': 0.35; 'question.': 0.35;
'understood': 0.35; 'mon,': 0.36; 'change': 0.36; 'really': 0.37;
"it's": 0.37; 'others': 0.37; 'way': 0.38; '8bit%:14': 0.38;
'changes': 0.39; 'quite': 0.39; 'use': 0.39; 'happen': 0.40;
'place.': 0.40; 'whenever': 0.40; 'something': 0.40; 'higher':
0.60; 'potential': 0.60; 'including': 0.60; "there's": 0.61;
'from:': 0.62; 'to:': 0.62; 'george': 0.62; 'here': 0.62; 'once':
0.63; 'skip:b 20': 0.63; 'skip:b 10': 0.63; 'our': 0.64; 're:':
0.64; 'his': 0.65; 'produce': 0.65; 'well': 0.65; 'named': 0.65;
'less': 0.65; 'forget': 0.67; 'before,': 0.69; 'interpreted':
0.69; 'refers': 0.69; 'times': 0.69; 'within': 0.69; 'languages,':
0.76; 'out,': 0.78; 'sent:': 0.78; 'header:Reply-To:1': 0.79;
'paul': 0.81; 'reasons': 0.84; 'adjusted': 0.84; 'assignment,':
0.84; 'garbage': 0.84; 'macro': 0.84; 'phase.': 0.84; 'pointer':
0.84; 'pointing': 0.84; 'so:': 0.84; 'convenience': 0.91;
'here\xe2\x80\x99s': 0.93; 'magic': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verizon.net; s=a2048;
t=1647899279; bh=woJqnpLDwJHoO0wf8x9cq5e6d8YmiMA17g1+yfnqTFg=;
h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject:Reply-To;
b=NiXlsAUhcjDBqghWi6lsRpGezaP6g+mvI2ioDAL6mO/tE29ZBjFOKCKgXs4jX0TOpmPPHsnt7b3JMRMLBQCixONuC1qv9EZR0KF/M/COKvwY8CtSnmVmodp3i6rI7PDglDrsRn0tb0lT2VyZKTXARgsuV4lY2gkrjOyWnIJMaKaoNF4I1Iv7Sn7FrFJSMSpjnSrUosv7ucsofduLZQyjkYa+J6ikSo3U+DXJ7kNxMaFFQBRJl7EC8Gzmaa3BFv/DiBdeB58dUxdSLRQ6nDwBNuh81qi0X6ubNeLevmMYrVTPIJPRjajlYp4PRTKzfX3UppE1AfUlKYNB9zCQ8qI8eQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
t=1647899279; bh=wHdChZZSeAmUmbuxlblLQFT3k4d3mwRuNxszK9BOJrU=;
h=X-Sonic-MF:Date:From:To:Subject:From:Subject;
b=TbqKmwfYp8gD5+TovFUCZA6NzKsJLtLmWvUXX6aek9d4oNRoeCp5eC3o71u7ZnKTYoGnZhiTirsa4hghURlcBIg3PdY0JdGx2eNOdKDeDPOnFlB0TTzad6WA6Lc0N7IqJwn60sEd3qhQD8MWF7otcp5t2Q/hEspwFiPGETtkmfKtu1Cjzg6uIwZrtVKX0UeS558DhDz1/51T9ChkN6Dbl7v6P4E72sTiKR7KjVK9uRsCNxjNn+CScWWwSdXfBAhqDpFMrT3UyUL95w9G36VGDVAtp1efG7s2E2kY/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qHR8GrJHbyzjP1PrElfrrRejU8mMFGK2EsiCQ7Gyk8RDt8WBz
OKLyEgVx7cZSatcMFsYwwI2_oJwvQS_m.WI1wHDn4YvR6gNn6PjAAmjF8fuq0ckUmDSg0zvv5kmz
zoSwW5yeubeJpnHu49vJC_XFPYOFNP4O_6SUTZQ_yOZW9aTT7hb2bPAueveZAP_nFOVqsvSZ4ZrR
eopQwuQvhtK8c76vib8w.BYgQs8q31r0-
X-Sonic-MF: <avigross@verizon.net>
In-Reply-To: <CAPTjJmr04OXW4k76Xa_9xd8p93gxzARUZUyUk6ehu-x53m2=ig@mail.gmail.com>
X-Mailer: WebService/1.1.19894 aolwebmail
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <651952493.752313.1647899276486@mail.yahoo.com>
X-Mailman-Original-References: <A779625E-5D40-410A-83C3-BA73E4108228@paulstgeorge.com>
<CAPTjJmr04OXW4k76Xa_9xd8p93gxzARUZUyUk6ehu-x53m2=ig@mail.gmail.com>
 by: Avi Gross - Mon, 21 Mar 2022 21:47 UTC

Chris,
I think you understood the context but not the premise in a sense that wasin the way Paul was thinking. His premise is way off
He seems to be thinking of something like a macro concept as iscommonly used in languages like C so:
#define context bpy.context
That could, in such languages, use a macro preprocessor, to parse the code once to make various textual changes without any real understanding of thelanguage and produce output ready for a compiler or interpreter phase. Python has nothing really like that albeit I can think of some things as well asgimmicks and tricks that can result in less typing. As an example, you canarrange for an object embedded within another to have some way to manipulate deeper structures from a higher level meaning less typing.
As you point out, in many  languages, often we are dealing with an implicit pointer withvery different results. And it is not at all the same in other ways, as you againpoint out so if you later re-assign bpy to anything else, including anotherdistinct object of the same kind, the variable called "context" keeps pointingto the old part of bpy. It is not an alias that can be used and it also is a potential problemfor various reasons such as retarding garbage collection or being used laterto make a change in the wrong place.
So, I ask Paul what other language than python he has used before, just out of curiosity.Many and perhaps most of use regulars here have used quite a few others and eachhas its own quirks and we have adjusted our thinking multiple times by the time welearned Python. What Paul suggests is just a convenience is more than that. It is a variablebinding with many ramifications.

-----Original Message-----
From: Chris Angelico <rosuav@gmail.com>
To: python-list@python.org
Sent: Mon, Mar 21, 2022 5:17 pm
Subject: Re: for convenience

On Tue, 22 Mar 2022 at 08:13, Paul St George <email@paulstgeorge.com> wrote:
>
>
> When I am writing code, I often do things like this:
>
> context = bpy.context  # convenience
>
> then whenever I need bpy.context, I only need to write context
>
>
> Here’s my question:
>
> When I forget to use the convenient shorter form
>
> why is bpy.context not interpreted as bpy.bpy.context?
>

I don't understand the question. When you do that "for convenience"
assignment, what you're doing is creating a local variable named
"context" which refers to the same thing that bpy.context does (or did
at the time of the assignment, but presumably you only do this when
bpy.context won't get reassigned). It has no effect on any other name.
There's no magic happening here - it's just assignment to the name
context, like anything else.

What are you expecting to happen here?

ChrisA
--
https://mail.python.org/mailman/listinfo/python-list

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor