[issue21399] inspect and class methods

2014-05-02 Thread Stefan Krah

Stefan Krah added the comment:

> By default AC emits "$type" for class methods, see dict_fromkeys in 
> Objects/dictobject.c.

Thanks, good choice.

--

___
Python tracker 

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



[issue21399] inspect and class methods

2014-05-01 Thread Larry Hastings

Larry Hastings added the comment:

By default AC emits "$type" for class methods, see dict_fromkeys in 
Objects/dictobject.c.

--

___
Python tracker 

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



[issue21399] inspect and class methods

2014-05-01 Thread Yury Selivanov

Yury Selivanov added the comment:

Yeah, I'm closing this issue.

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue21399] inspect and class methods

2014-05-01 Thread Stefan Krah

Stefan Krah added the comment:

Okay, thanks.  I've used "$cls" for Decimal.from_float in 40b06a75d1c6,
and it appears to work already.


Feel free to close the issue (I don't know whether AC emits "$cls" or
if it should).

--

___
Python tracker 

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



[issue21399] inspect and class methods

2014-04-30 Thread Yury Selivanov

Yury Selivanov added the comment:

> In Python2.7, the cls parameter shows up in pydoc:
>
>frombuf(cls, buf) from __builtin__.type
>Construct a TarInfo object from a 512 byte string buffer.
>
>
> In 3.5, it doesn't:
>
>frombuf(buf, encoding, errors) from builtins.type
>Construct a TarInfo object from a 512 byte bytes object.

Yes, that's a correct behaviour in 3.4 and 3.5. See #20710 for details.

> >>> signature(TarInfo.create_gnu_header)
> 
> >>> signature(TarInfo.frombuf)
> 

There is no bug here. `TarInfo.create_gnu_header` is an unbound method, that 
indeed requires first argument 'self'.  `TarInfo.frombuf` is a classmethod, so 
it doesn't need a 'cls' arg.  Signature, by default and by design, only shows 
arguments that need to be passed to correctly execute the given callable.

> How about the C docstrings? Can we get "$cls" for classmethods?

Yes, I think it should work.

--
nosy: +yselivanov

___
Python tracker 

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



[issue21399] inspect and class methods

2014-04-30 Thread Stefan Krah

New submission from Stefan Krah:

In Python2.7, the cls parameter shows up in pydoc:

frombuf(cls, buf) from __builtin__.type
Construct a TarInfo object from a 512 byte string buffer.


In 3.5, it doesn't:

frombuf(buf, encoding, errors) from builtins.type
Construct a TarInfo object from a 512 byte bytes object.



inspect.signature shows 'self', but not 'cls':

>>> from tarfile import *
>>> from inspect import *
>>> signature(TarInfo.create_gnu_header)

>>> signature(TarInfo.frombuf)



So my guess is that this is an oversight.  How about the C docstrings?
Can we get "$cls" for classmethods?

--
messages: 217606
nosy: Yury.Selivanov, larry, skrah
priority: normal
severity: normal
status: open
title: inspect and class methods
type: behavior
versions: Python 3.4, Python 3.5

___
Python tracker 

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