[Python-bugs-list] [ python-Bugs-671439 ] fix for 569257 isn't in 2.2.2 - __slots__ still not mangled

SourceForge.net noreply@sourceforge.net
Mon, 20 Jan 2003 15:12:28 -0800


Bugs item #671439, was opened at 2003-01-20 17:45
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=671439&group_id=5470

Category: Type/class unification
Group: Python 2.2.2
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Jess Austin (jessaustin)
Assigned to: Nobody/Anonymous (nobody)
Summary: fix for 569257 isn't in 2.2.2 - __slots__ still not mangled

Initial Comment:
hi,

Perhaps this isn't the right way to notify you that a patch 
didn't make it in.  If so I'm sorry.

I'm concerned that the fix for bug #569257 didn't make it 
into Python 2.2.2 on Windows.  My description of the 
bug, that I had written before I noticed #569257, follows.  
The original bug seems to have been resolved last June.  
I would have expected it to show up in 2.2.2.

thanks,
Jess Austin




<description of bug>

Variables listed in __slots__ for a new-style class that 
start with double underscores are not mangled.  
Entering the following code:

class a(object):
    __slots__ = ['__x']
    def __init__(self, x):
        self.__x = x
    
m = a(1)

Yields the following exception:

Traceback (most recent call last):
  File "<input>", line 1, in ?
  File "<input>", line 4, in __init__
AttributeError: 'a' object has no attribute '_a__x'

Whereas entering the following returns 1 just as one 
would expect:

class b(object):
    __slots__ = ['_b__x']
    def __init__(self, x):
        self.__x = x
    
n = b(1)
n._b__x

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

>Comment By: Neal Norwitz (nnorwitz)
Date: 2003-01-20 18:12

Message:
Logged In: YES 
user_id=33168

See Guido's comment on 2002-06-19 15:30 in the original bug
report.  He indicates that using mangled names in __slots__
should be considered a new feature.  Therefore, there was no
attempt to backport the change.

I'm closing this bug for that reason.  If you would like to
see the feature backported, you should raise the issue on
the mailing list python-dev@python.org.

Submitting this bug report was fine.


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

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