[Python-ideas] Re: Link: Bidirectional Aliasing in Python

2019-09-24 Thread Nutchanon Ninyawee
Richard Musil wrote: > I had an idea for an abstract representation of the feature Nutchanon > described. Let's call it aliasing and let's define it intuitively: > a = 1 > b alias a > print(b) -> 1 > b = 2 > print(a) -> 2 > The abstract representation would define a new construct > _aliased_identif

[Python-ideas] Re: Link: Bidirectional Aliasing in Python

2019-09-24 Thread Richard Musil
On Tue, Sep 24, 2019 at 5:55 AM Stephen J. Turnbull < [email protected]> wrote: > Richard Musil writes: > > > The implementation can be an additional attribute on an identifier > > That's not an implementation yet. From the point of view of the > Python program, an identifier i

[Python-ideas] Re: Link: Bidirectional Aliasing in Python

2019-09-24 Thread Richard Musil
On Tue, Sep 24, 2019 at 10:26 AM Nutchanon Ninyawee wrote: > Talking about `del` and `unaid()` ("un-alias" or `unlink()` in my previous > mention), I think `del` should keep its ability to let garbage collection > free the memory. > if we use the keyword del to "unbind" and "un-alias" that could

[Python-ideas] Re: Link: Bidirectional Aliasing in Python

2019-09-24 Thread Richard Damon
On 9/24/19 4:54 AM, Richard Musil wrote: > On Tue, Sep 24, 2019 at 5:55 AM Stephen J. Turnbull > > wrote: > > Richard Musil writes: > >  > The implementation can be an additional attribute on an identifier > > That's not an implementation yet

[Python-ideas] Re: Add a slot for "keys" in tp_as_mapping

2019-09-24 Thread Serhiy Storchaka
19.09.19 11:00, Greg Ewing пише: Serhiy Storchaka wrote: PyDict_Merge() is called every time when you have a call like `f(a=1, **kw)` So would not be worth to add slots for keys (and maybe for values and items) to the tp_as_mapping structure? Only if looking up those methods is taking a sub