[issue13448] PEP 3155 implementation

2012-03-18 Thread Matt Joiner

Matt Joiner  added the comment:

Doc/library/dis.rst wasn't updated for the extra pop introduced to MAKE_CLOSURE 
opcode.

--
nosy: +anacrolix

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-21 Thread Antoine Pitrou

New submission from Antoine Pitrou :

Here is an issue covering PEP 3155 implementation. Hopefully a "review" link 
will appear in front of the hg repo URL.

--
components: Interpreter Core
hgrepos: 91
messages: 148087
nosy: ncoghlan, pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: PEP 3155 implementation
type: feature request
versions: Python 3.3

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-21 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
keywords: +patch
Added file: http://bugs.python.org/file23744/baec10c6dcd4.diff

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-21 Thread STINNER Victor

STINNER Victor  added the comment:

I just have a comment: "XXX" should be replaced in "Python 3.3a0  3200 XXX".

--
nosy: +haypo

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-22 Thread Éric Araujo

Éric Araujo  added the comment:

Nothing to say; waiting for a doc update.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-23 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Added file: http://bugs.python.org/file23766/942ba1e2f8c1.diff

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

New patch addressing Benjamin's and Victor's comments.

--

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-23 Thread STINNER Victor

STINNER Victor  added the comment:

Ah, PyFunction_NewWithQualName is now public.

Why an upper P in "PyFunction_NewWithQualName"? If you use an upper P, it 
should use an underscore in Python: __qual_name__ to be consistent. So I 
suggest to change the C name :-) PyFunction_NewWithQualname or 
PyFunction_NewWithQualifiedName. I don't have a preference between these two 
choices.

--

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Why an upper P in "PyFunction_NewWithQualName"? If you use an upper P,
> it should use an underscore in Python: __qual_name__ to be consistent.

__getattr__ / PyObject_GetAttr.

--

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-24 Thread Éric Araujo

Éric Araujo  added the comment:

BTW Antoine, will you update the doc to mention __qualname__ or would you like 
help?

--

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-24 Thread Éric Araujo

Éric Araujo  added the comment:

Doc patch looks good.

--

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-24 Thread Éric Araujo

Éric Araujo  added the comment:

And of course, right after I post this I look at my terminal and see the “Add 
docs” commit.  Ignore me.

--

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-24 Thread Éric Araujo

Changes by Éric Araujo :


--
Removed message: http://bugs.python.org/msg148253

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-24 Thread Éric Araujo

Changes by Éric Araujo :


--
Removed message: http://bugs.python.org/msg148252

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-24 Thread sbt

sbt  added the comment:

Is it intended that pickle will use __qualname__?

--
nosy: +sbt

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-24 Thread Nick Coghlan

Nick Coghlan  added the comment:

Yes, but that can be a separate patch - step 1 is to make the attribute 
available, then relevant modules can subsequently be updated to use it as 
appropriate.

--

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Is it intended that pickle will use __qualname__?

That's part of the plan for PEP 3154, yes.

--

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-25 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e1dbc72bd97f by Antoine Pitrou in branch 'default':
PEP 3155 / issue #13448: Qualified name for classes and functions.
http://hg.python.org/cpython/rev/e1dbc72bd97f

--
nosy: +python-dev

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Now committed together with docs and a what's new entry. Thanks for the reviews!

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-25 Thread sbt

sbt  added the comment:

There are some callables which are missing __qualname__:

  method_descriptor
  wrapper_descriptor
  builtin_function_or_method

For the descriptors, at least, obj.__qualname__ should be equivalent to

  obj.__objclass__.__qualname__ + '.' + obj.__name__

Were these overlooked?

  PS C:\Repos\cpython> .\PCbuild\python_d
  Python 3.3.0a0 (default, Nov 25 2011, 22:14:28) [MSC v.1500 32 bit (Intel)] 
on win32
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import pickle
  [66213 refs]
  >>> attribs = ('__class__', '__name__', '__qualname__')
  [66220 refs]
  >>> for o in (pickle.Pickler, pickle.Pickler.dump, object.__init__, min):
  ...   print([getattr(o, a, None) for a in attribs])
  ...
  [, 'Pickler', 'Pickler']
  [, 'dump', None]
  [, '__init__', None]
  [, 'min', None]
  [66265 refs]

Also I notice that bound methods have a misleading __qualname__:

  >>> class A:
  ...   def f(self): pass
  ...
  [66348 refs]
  >>> A().f.__qualname__
  'A.f'

Maybe this should be 'A().f' instead.

--

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-25 Thread sbt

sbt  added the comment:

For builtin_function_or_method it seems obj.__qualname__ should be

  obj.__self__.__qualname__ + '.' + obj.__name__

--

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-11-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> There are some callables which are missing __qualname__:
> 
>   method_descriptor
>   wrapper_descriptor
>   builtin_function_or_method
> 
> For the descriptors, at least, obj.__qualname__ should be equivalent to
> 
>   obj.__objclass__.__qualname__ + '.' + obj.__name__
> 
> Were these overlooked?

Indeed, they were overlooked. Due to the way they are instantiated,
though, it would be quite a bit harder to devise a __qualname__ for
them.

> Also I notice that bound methods have a misleading __qualname__:
> 
>   >>> class A:
>   ...   def f(self): pass
>   ...
>   [66348 refs]
>   >>> A().f.__qualname__
>   'A.f'
> 
> Maybe this should be 'A().f' instead.

I am a bit surprised that this works at all. Apparently attribute
lookups are redirected to the underlying function.

--

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-12-10 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-12-10 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

I am evaluating the use of "__qualname__" in my dtrace probes (issue #13405) 
and I see things like this:

"""
>>> def a() :
...   class b() :
... pass
...   return b()
... 
>>> c=a()
>>> c
<__main__.a..b object at 0xfe37f3ac>
>>> c.__qualname__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'b' object has no attribute '__qualname__'
>>> a

>>> a.__qualname__
'a'
"""

I guess the class should have a __qualname__ too, haven't it?

--

___
Python tracker 

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



[issue13448] PEP 3155 implementation

2011-12-10 Thread Nick Coghlan

Nick Coghlan  added the comment:

No, it's only class objects that have __name__ and __qualname__, not class 
instances.

--

___
Python tracker 

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