A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-June/073737.html below:

[Python-Dev] object capability; func_closure; __subclasses__

[Python-Dev] object capability; func_closure; __subclasses__Phillip J. Eby pje at telecommunity.com
Thu Jun 28 19:34:05 CEST 2007
At 10:20 AM 6/28/2007 -0700, Robert Brewer wrote:
>tav wrote:
> > But, all I am asking for is to not expose func_closure (and perhaps
> > some of the other func_*) as members of FunctionType -- isn't it
> > possible to add functionality to the ``new`` module which would allow
> > one to read/write func_closure?
>
>Would func_closure then also be removed from the FunctionType
>constructor arg list?

That wouldn't be necessary, since restricted code is probably not 
going to be allowed access to new in the first place.  We're talking 
about removing read access to the closure *attribute* only.  (And 
write access to func_code would also have to be removed, else you 
could replace the bytecode in order to grant yourself read access to 
the closure contents...)


>If so, would I be expected to create a function
>object and then use the "new" module to supply its func_closure?

Nope.  The idea here is that the new module would grow utility 
functions like get_closure, get_code, set_code, get_subclasses, 
etc.  The 'inspect' module would then use these functions to do its 
job, and I would use them for generic function stuff.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4