[issue18690] memoryview not considered a sequence

2013-08-08 Thread Simon Feltman

New submission from Simon Feltman:

This was a bit unexpected as memoryviews support all the methods of the 
Sequence abstract base class:

>>> import collections
>>> b = bytearray(b'asdf')
>>> isinstance(b, collections.Sequence)
True
>>> m = memoryview(b)
>>> isinstance(m, collections.Sequence)
False

It would be nice if memoryview was registered with the Sequence ABC and 
MutableSequence for writeable memoryviews.

--
components: Library (Lib)
messages: 194707
nosy: sfeltman
priority: normal
severity: normal
status: open
title: memoryview not considered a sequence
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 
<http://bugs.python.org/issue18690>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Simon Feltman

New submission from Simon Feltman:

This came up while trying to build pygobject with Python 3.3. The problem is 
there are some erroneous imports in the fromlist with these bindings that can 
easily be fixed. But it is a behavioral change so I just wanted to raise 
awareness if it is not already known.

$ python3.2 -c "__import__('http', fromlist=['blah'])"
(works)

$ python3.3 -c "__import__('http', fromlist=['blah'])"
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named 'http.blah'


Note this is also the case when using the C API: PyImport_ImportModuleEx

--
components: None
messages: 168423
nosy: sfeltman
priority: normal
severity: normal
status: open
title: __import__ now raises with non-existing items in fromlist in 3.3
versions: Python 3.3

___
Python tracker 
<http://bugs.python.org/issue15715>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Simon Feltman

Changes by Simon Feltman :


--
type:  -> behavior

___
Python tracker 
<http://bugs.python.org/issue15715>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Simon Feltman

Simon Feltman added the comment:

I think pygobject still supports Python 2.5 which it look like importlib is 
available.

I've submitted a patch to pygobject which will work regardless of if this 
regression is fixed or not: https://bugzilla.gnome.org/show_bug.cgi?id=682051

--

___
Python tracker 
<http://bugs.python.org/issue15715>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15715] __import__ now raises with non-existing items in fromlist in 3.3

2012-08-16 Thread Simon Feltman

Simon Feltman added the comment:

Should have been "...Python 2.5 which it looks like importlib is NOT available."

--

___
Python tracker 
<http://bugs.python.org/issue15715>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16452] Add support for weak reference to bound methods

2012-11-11 Thread Simon Feltman

New submission from Simon Feltman:

This is a feature request to include a "WeakMethod" or similar object to the 
weakref module. The object decomposes a bound method and holds a weakref to the 
object and unbound function. This can be a very useful utility in signal and ui 
based programming.

The issue has come up a few times but I was unable to find a bug specifically 
requesting this feature. I think similar code has shown up in enough libraries 
at this point that it makes sense to just include it in pythons weakref module.

See also:
http://bugs.python.org/issue813299
http://bugs.python.org/issue7464

This is the recipes:
http://code.activestate.com/recipes/81253/
http://mindtrove.info/python-weak-references/

--
components: None
messages: 175337
nosy: sfeltman
priority: normal
severity: normal
status: open
title: Add support for weak reference to bound methods
type: enhancement

___
Python tracker 
<http://bugs.python.org/issue16452>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16452] Add support for weak reference to bound methods

2012-11-11 Thread Simon Feltman

Simon Feltman added the comment:

Indeed a duplicate of: http://bugs.python.org/issue14631

--
resolution:  -> duplicate
status: open -> closed

___
Python tracker 
<http://bugs.python.org/issue16452>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14631] Instance methods and WeakRefs don't mix.

2012-11-11 Thread Simon Feltman

Simon Feltman added the comment:

Just a note this is also referred to as a "WeakMethod" by some folks (so this 
ticket shows up in those searches). See also:
http://bugs.python.org/issue813299
http://bugs.python.org/issue7464
http://bugs.python.org/issue16452

--

___
Python tracker 
<http://bugs.python.org/issue14631>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14631] Instance methods and WeakRefs don't mix.

2012-11-11 Thread Simon Feltman

Simon Feltman added the comment:

The WeakCallableRef that was attached seemed to support regular functions (or 
anything callable) which is nice. The naming also leaves room for a 
WeakCallableProxy.

--

___
Python tracker 
<http://bugs.python.org/issue14631>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14631] Instance methods and WeakRefs don't mix.

2012-11-11 Thread Simon Feltman

Simon Feltman added the comment:

Some more complex examples from various libraries:

https://github.com/django/django/blob/master/django/dispatch/saferef.py
https://github.com/11craft/louie/blob/master/louie/saferef.py

I think both of these originated in pydispatcher.

--

___
Python tracker 
<http://bugs.python.org/issue14631>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com