[issue24329] __qualname__ and __slots__

2017-03-24 Thread Xiang Zhang

Xiang Zhang added the comment:


New changeset c393ee858932f79bd6dabf31550f9a53ea90bc68 by Xiang Zhang in branch 
'master':
bpo-24329: allow __qualname__ and __classcell__ in __slots__ (GH-495)
https://github.com/python/cpython/commit/c393ee858932f79bd6dabf31550f9a53ea90bc68


--

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2017-03-07 Thread Xiang Zhang

Changes by Xiang Zhang :


--
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



[issue24329] __qualname__ and __slots__

2017-03-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee: serhiy.storchaka -> xiang.zhang

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2017-03-05 Thread Xiang Zhang

Xiang Zhang added the comment:

PR made. :-)

--

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2017-03-05 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +405

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2017-03-03 Thread Yury Selivanov

Changes by Yury Selivanov :


--
versions:  -Python 3.5, Python 3.6

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2017-03-03 Thread Yury Selivanov

Yury Selivanov added the comment:

Xiang, can you make a PR?

--

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-12-05 Thread Xiang Zhang

Xiang Zhang added the comment:

> However, consistency is a good thing, so allowing it seems reasonable.

The inconsistency also appears when "__classcell__" in slots with or without 
super().

v4 catches up with HEAD.

--
Added file: http://bugs.python.org/file45762/slots_special-v4.patch

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-12-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +During metaclass.__init__, super() of the constructed class does 
not work

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-12-04 Thread Nick Coghlan

Nick Coghlan added the comment:

"__classcell__" in __slots__ doesn't really make sense, as unlike __qualname__ 
(which turns into a real class level attribute and can be useful to override on 
instances), it's only a transient entry in a class definition namespace - 
types.__new__ pops it automatically so it doesn't get turned into an attribute.

However, consistency is a good thing, so allowing it seems reasonable.

Regarding the specifics, the pending patch on issue 23722 makes it a TypeError 
to ever set __classcell__ to anything other than a real cell object.

--

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Nick, could you please look at the patch? Especially at the part about 
__classcell__.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
versions: +Python 3.5

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-11 Thread Xiang Zhang

Xiang Zhang added the comment:

v3 updates the test cases.

--
Added file: http://bugs.python.org/file45444/slots_special_v3.patch

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

__qualname__ doesn't makes much sense if it doesn't match __module__. If 
_GeneratorWrapper patches __qualname__, I think it should patch __module__ too.

--

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-10 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-10 Thread Xiang Zhang

Xiang Zhang added the comment:

slots_special_v2 fixes a bug in the previous patch.

--
Added file: http://bugs.python.org/file45425/slots_special_v2.patch

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-10 Thread Xiang Zhang

Xiang Zhang added the comment:

> What about other names set when creating a class? __module__, __class__, 
> __classcell__?

__module__ remains in the class dict so I think it's a class variable.
Will __class__ be set? It's inserted into the function scope.
__classcell__ I think has the same situation with __qualname__.

New patch also adds __classcell__.

--
Added file: http://bugs.python.org/file45423/slots_special.patch

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-10 Thread Xiang Zhang

Changes by Xiang Zhang :


Added file: http://bugs.python.org/file45421/slots_qualname_v2.patch

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-10 Thread Xiang Zhang

Xiang Zhang added the comment:

I think of them but currently they don't pose a problem for practical codes 
like __qualname__. Maybe leaving them until there comes a real need?

--

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What about other names set when creating a class? __module__, __class__, 
__classcell__?

--

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-09 Thread Xiang Zhang

Changes by Xiang Zhang :


--
keywords: +patch
stage:  -> patch review
type:  -> behavior
Added file: http://bugs.python.org/file45420/slots_qualname.patch

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-09 Thread Yury Selivanov

Yury Selivanov added the comment:

Because the following works without a problem:

  class F:
__slots__ = ('__name__', )

  f = F()
  f.__name__ = ''

This bug with __qualname__ is why _GeneratorWrapper in types.py doesn't have 
__slots__.

--

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-09 Thread Xiang Zhang

Xiang Zhang added the comment:

Why should it work Yury?

__qualname__ and __doc__(if exists) are inserted into the dict when creating a 
class.

>>> class Foo:
... """bar"""
... __slots__ = ('__doc__',)
... 
Traceback (most recent call last):
  File "", line 1, in 
ValueError: '__doc__' in __slots__ conflicts with class variable

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2016-11-09 Thread Yury Selivanov

Yury Selivanov added the comment:

Serhiy, maybe you know how to fix this?

--
nosy: +serhiy.storchaka
versions: +Python 3.7 -Python 3.5

___
Python tracker 

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



[issue24329] __qualname__ and __slots__

2015-07-21 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


--
nosy:  -ethan.furman

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



[issue24329] __qualname__ and __slots__

2015-06-01 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue24329] __qualname__ and __slots__

2015-05-29 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


--
nosy: +ethan.furman

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



[issue24329] __qualname__ and __slots__

2015-05-29 Thread Yury Selivanov

New submission from Yury Selivanov:

The following code doesn't work.  Would be great if we can fix it in 3.5

class Foo:
__slots__ = ('__qualname__',)

--
components: Interpreter Core
messages: 244410
nosy: pitrou, yselivanov
priority: normal
severity: normal
status: open
title: __qualname__ and __slots__
versions: Python 3.5, Python 3.6

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