Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: Asymmetry in globals __getitem__/__setitem__ Date: Fri, 13 Jun 2014 12:38:24 +1200 Lines: 11 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net dz2NVpA6mC1//xoxNYrlRQhxL5g3H4iERHcb/4jd7Afyvp1ztm Cancel-Lock: sha1:HI+Eb092yov6Z4iR6PzzL+Kgtq8= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: Xref: csiph.com comp.lang.python:73245 Robert Lehmann wrote: > I have noticed there is a slight asymmetry in the way the interpreter > (v3.3.5, reproduced also in v3.5.x) loads and stores globals. While > loading globals from a custom mapping triggers __getitem__ just fine, > writing seems to silently ignore __setitem__. I didn't think that using a custom mapping object for globals was officially supported. Has that changed? -- Greg