[issue22958] Constructors of weakref mapping classes don't accept "self" and "dict" keyword arguments

2015-09-29 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue22958] Constructors of weakref mapping classes don't accept "self" and "dict" keyword arguments

2015-09-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8274fc521e69 by Serhiy Storchaka in branch '2.7':
Issue #22958: Constructor and update method of weakref.WeakValueDictionary
https://hg.python.org/cpython/rev/8274fc521e69

New changeset 01c79072d671 by Serhiy Storchaka in branch '3.4':
Issue #22958: Constructor and update method of weakref.WeakValueDictionary
https://hg.python.org/cpython/rev/01c79072d671

New changeset 73b6b88ac28a by Serhiy Storchaka in branch '3.5':
Issue #22958: Constructor and update method of weakref.WeakValueDictionary
https://hg.python.org/cpython/rev/73b6b88ac28a

New changeset 815bb6a2d69e by Serhiy Storchaka in branch 'default':
Issue #22958: Constructor and update method of weakref.WeakValueDictionary
https://hg.python.org/cpython/rev/815bb6a2d69e

--
nosy: +python-dev

___
Python tracker 

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



[issue22958] Constructors of weakref mapping classes don't accept self and dict keyword arguments

2015-05-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
dependencies: +Constructors of some mapping classes don't accept `self` keyword 
argument

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



[issue22958] Constructors of weakref mapping classes don't accept self and dict keyword arguments

2015-03-20 Thread Benjamin Peterson

Benjamin Peterson added the comment:

lgtm

--
nosy: +benjamin.peterson

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



[issue22958] Constructors of weakref mapping classes don't accept self and dict keyword arguments

2014-12-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch similar to patch from issue22609 which makes 
WeakValueDictionary constructor and update accept keyword arguments self and 
dict.

--
keywords: +needs review, patch
stage:  - patch review
Added file: 
http://bugs.python.org/file37395/WeakValueDictionary_pos_only_params.patch

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



[issue22958] Constructors of weakref mapping classes don't accept self and dict keyword arguments

2014-11-27 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Dict-like types in the weakref module (WeakValueDictionary and 
WeakKeyDictionary) don't allow to specify key-value pair as keyword arguments 
if key is self or dict.

 import weakref
 class A: pass
... 
 a = A()
 d = weakref.WeakValueDictionary(spam=a)
 list(d.items())
[('spam', __main__.A object at 0xb6f3f88c)]
 weakref.WeakValueDictionary(self=a)
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: __init__() got multiple values for argument 'self'
 weakref.WeakValueDictionary(dict=a)
Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/serhiy/py/cpython/Lib/weakref.py, line 114, in __init__
self.update(*args, **kw)
  File /home/serhiy/py/cpython/Lib/weakref.py, line 261, in update
dict = type({})(dict)
TypeError: 'A' object is not iterable
 d = weakref.WeakValueDictionary()
 d.update(spam=a)
 list(d.items())
[('spam', __main__.A object at 0xb6f3f88c)]
 d.update(self=a)
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: update() got multiple values for argument 'self'
 d.update(dict=a)
Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/serhiy/py/cpython/Lib/weakref.py, line 261, in update
dict = type({})(dict)
TypeError: 'A' object is not iterable

Related issue for the collections module is issue22609. I think weakref mapping 
classes should be fixed in the same manner.

--
components: Library (Lib)
messages: 231767
nosy: fdrake, pitrou, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Constructors of weakref mapping classes don't accept self and dict 
keyword arguments
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

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