[issue30486] Allow setting cell value

2017-09-20 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 0ad05c32cc41d4c21bfd78b9ffead519ead475a2 by Victor Stinner in 
branch 'master':
bpo-30486: Make cell_set_contents() symbol private (#3668)
https://github.com/python/cpython/commit/0ad05c32cc41d4c21bfd78b9ffead519ead475a2


--
nosy: +haypo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30486] Allow setting cell value

2017-09-20 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3658

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30486] Allow setting cell value

2017-06-08 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30486] Allow setting cell value

2017-06-08 Thread Lisa Roach

Lisa Roach added the comment:

Thank you for you guidance, Serhiy!

On Thu, Jun 8, 2017 at 4:45 AM, Serhiy Storchaka 
wrote:

>
> Serhiy Storchaka added the comment:
>
> Thank you for your contribution Lisa!
>
> --
> resolution:  -> fixed
> stage: patch review -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30486] Allow setting cell value

2017-06-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your contribution Lisa!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30486] Allow setting cell value

2017-06-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 64505a1f6c0af4574e17e823b27ffe24eca44df5 by Serhiy Storchaka 
(Lisa Roach) in branch 'master':
bpo-30486: Allow setting cell value (#1840)
https://github.com/python/cpython/commit/64505a1f6c0af4574e17e823b27ffe24eca44df5


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30486] Allow setting cell value

2017-06-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

There's already a documentation change to the PR, you can leave your comments 
there.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30486] Allow setting cell value

2017-06-02 Thread Terry J. Reedy

Terry J. Reedy added the comment:

A possible counter-indication would be if setting a cell could cause a crash, 
as opposed to a mysterious exception.  Since 3.x already allows writing any 
object to a cell from python code,
 
def outer():
cell = None
def inner(ob):
nonlocal cell
cell = ob  # rebinds .cell_contents
return inner

set_cell = outer()
print(set_cell.__closure__[0].cell_contents)  # None
set_cell('something')
print(set_cell.__closure__[0].cell_contents)  # 'something'

making "cell.cell_contents = 'something'" legal should not enable more crashes.

I think that "function.__closure__[i].cell_contents = object" is perhaps not a 
good idea for production code, but I think it falls within the realm of 
'consenting adults code' for the other uses suggested above.  How should it be 
documented?

--
nosy: +terry.reedy
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30486] Allow setting cell value

2017-05-27 Thread Lisa Roach

Changes by Lisa Roach :


--
pull_requests: +1925

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30486] Allow setting cell value

2017-05-27 Thread Nick Coghlan

Nick Coghlan added the comment:

+1 from me, as this also has potential value in testing use cases and in 
dealing with some of the consequences of the zero-arg super() design (i.e. it 
will make the injected __class__ cell writable)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30486] Allow setting cell value

2017-05-26 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> lisroach

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30486] Allow setting cell value

2017-05-26 Thread Raymond Hettinger

Raymond Hettinger added the comment:

+1  I don't see any reason this can't be writeable.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30486] Allow setting cell value

2017-05-26 Thread Lisa Roach

Lisa Roach added the comment:

This idea makes sense to me. I'll see if I can put together the code for it.

--
nosy: +lisroach

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30486] Allow setting cell value

2017-05-26 Thread Jim Fasarakis-Hilliard

Changes by Jim Fasarakis-Hilliard :


--
nosy: +Jim Fasarakis-Hilliard

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30486] Allow setting cell value

2017-05-26 Thread Antoine Pitrou

New submission from Antoine Pitrou:

There are use cases for setting a cell value.  One such use case is for 
(un)pickling recursive closures (see heroic workaround here: 
https://github.com/cloudpipe/cloudpickle/pull/90/files#diff-d2a3618afedd4e124c532151eedbae09R74
 ).  Other use cases may include tinkering around and general education value.

There also doesn't seem to be, AFAICS, any counter-indication to being able to 
do so.  It's already possible in C using PyCell_Set(), which is a public API.  
It just lacks an API in Python land.  For example `cell_contents` could become 
a read/write property...

--
components: Interpreter Core
messages: 294554
nosy: benjamin.peterson, gvanrossum, ncoghlan, pitrou, rhettinger
priority: normal
severity: normal
stage: needs patch
status: open
title: Allow setting cell value
type: enhancement
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com