[Patches] [ python-Patches-1402289 ] Fix dictionary subclass semantics when used as global dicts.

SourceForge.net noreply at sourceforge.net
Wed Jan 11 03:16:51 CET 2006


Patches item #1402289, was opened at 2006-01-10 16:24
Message generated for change (Comment added) made by crutcher_gmail
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1402289&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core (C code)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: crutcher (crutcher_gmail)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix dictionary subclass semantics when used as global dicts.

Initial Comment:
There is an inconsistancy in the way that dictionary
subclasses behave
when they are used as as namespaces in execs.

Basically, while python 2.4 permits the usage of
dictionary subclasses
for local environments, it still bypasses the subclass
functions and
uses the C API for global environments. The attached
patch (and
unittest!) addresses this issue.

I'm pretty sure we keep the fast path in this.

----------------------------------------------------------------------

>Comment By: crutcher (crutcher_gmail)
Date: 2006-01-10 18:16

Message:
Logged In: YES 
user_id=1424288

With the ability to use dictionary subclasses for local and
global environments, it becomes very easy to implement
execution environments with extended variable semantics for
special purposes.

This includes driving interactive processes, config file
processors, type checking, lazy object construction, and
read-only variables.

As it currently stands, the semantics are inconsistent. The
local case should not have been changed if the global case
was not going to be changed.

----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)
Date: 2006-01-10 18:03

Message:
Logged In: YES 
user_id=80475

Do you have any use cases?  AFAICT, there were no unmet
needs with locals option.

Also, there was a reason that globals weren't included but I
remember what it was.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1402289&group_id=5470


More information about the Patches mailing list