[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your contribution Xiang Zhang.

--
resolution:  -> fixed
stage: commit 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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d14ea3964590 by Serhiy Storchaka in branch '3.5':
Issue #26733: Disassembling a class now disassembles class and static methods.
https://hg.python.org/cpython/rev/d14ea3964590

New changeset f96fec10cf25 by Serhiy Storchaka in branch 'default':
Issue #26733: Disassembling a class now disassembles class and static methods.
https://hg.python.org/cpython/rev/f96fec10cf25

--

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
stage: patch review -> commit review
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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-17 Thread Nick Coghlan

Nick Coghlan added the comment:

Looking at the history of the dis module, I'd now class this as a bug fix for 
3.5+ - it looks like dis.dis gained the ability to disassemble static and class 
methods as a side-effect of the removal of bound methods in Python 3 (see 
https://hg.python.org/cpython/rev/48af6375207e ) but because it was a side 
effect, the additional changes needed to also handle them when disassembling a 
class were missed.

--

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

Nick, do you consider this as a new feature, or as a fix?

--

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-12 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks for your comments Serhiy. I update the patch according to your comments.

Actually I don't think this is a new feature. Maybe staticmethod and 
classmethod are just forgotten.

As for separate tests for staticmethod and classmethod, I think they are not 
needed for this patch since right now we can use dis.dis to disassemble them 
explicitly. Only when dis.dis a class they are missing. But since there are no 
tests for them, adding tests for them is good.

--
Added file: 
http://bugs.python.org/file42442/add_staticmethod_and_classmethod_when_dis.dis_a_class_v5.patch

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b114a0650c44 by Serhiy Storchaka in branch '3.5':
Issue #26733: Fixed formatting line numbers in test_dis.
https://hg.python.org/cpython/rev/b114a0650c44

New changeset e0816ce68952 by Serhiy Storchaka in branch 'default':
Issue #26733: Fixed formatting line numbers in test_dis.
https://hg.python.org/cpython/rev/e0816ce68952

New changeset 16a27e38e9b5 by Serhiy Storchaka in branch '2.7':
Issue #26733: Fixed formatting line numbers in test_dis.
https://hg.python.org/cpython/rev/16a27e38e9b5

--
nosy: +python-dev

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If this is new feature, perhaps the docs need the versionchanged directive. 
Otherwise the patch should be applied to all maintained branches.

Added other comments on Rietveld.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Xiang Zhang

Xiang Zhang added the comment:

I update the documentation. Learning from devguide, the change of whatsnew is 
the committer's work. ;)

--
Added file: 
http://bugs.python.org/file42439/add_staticmethod_and_classmethod_when_dis.dis_a_class_v4.patch

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Nick Coghlan

Nick Coghlan added the comment:

The code and test changes in the latest patch look good to me. For 
documentation, I suggest updating 
https://docs.python.org/3/library/dis.html#dis.dis to:

- say "it disassembles all methods (including class and static methods)" when 
describing how classes are handled.

- add a version changed note for 3.6 to say that class and static methods are 
disassembled in addition to normal instance methods when disassembling a class

--

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Xiang Zhang

Xiang Zhang added the comment:

After researching the code, I think changing ' %-4d' to '%3d' in dis_bug708901 
is right. Since I added some some lines and the lineno of test_bug708901 has 
arrived at 100+ and the leading space should not be there. According to the 
code of dis.dis, the right format string should be '%3d'. Not only 
test_bug708901, all the other ' %-4d' should be changed to '%3d'. If we add 
1000+ lines at the head of the file, then all the ' %-4d' format string will 
lead to test failures.

I update my patch.

--
Added file: 
http://bugs.python.org/file42431/add_staticmethod_and_classmethod_when_dis.dis_a_class_v3.patch

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +ncoghlan, yselivanov
stage:  -> patch review

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Xiang Zhang

Xiang Zhang added the comment:

Though don't know why but simply replace %-4d with %3d in dis_bug708901 can fix 
the test. I updated the patch so all the tests pass and then I'll spend some 
time figuring out why.

--
Added file: 
http://bugs.python.org/file42430/add_staticmethod_and_classmethod_when_dis.dis_a_class_v2.patch

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Xiang Zhang

Changes by Xiang Zhang :


--
components: +Library (Lib)
type:  -> behavior
versions: +Python 3.6

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-11 Thread Xiang Zhang

New submission from Xiang Zhang:

Though the documentation tells when disassembling a class, it disassembles all 
methods for dis.dis, but staticmethod and classmethod are ignored. I don't know 
whether this is intended.

I write to patch to add staticmethod and classmethod. But unfortunately when I 
write tests, one unrelated test fails and I cannot figure out why.

--
files: add_staticmethod_and_classmethod_when_dis.dis_a_class.patch
keywords: patch
messages: 263176
nosy: xiang.zhang
priority: normal
severity: normal
status: open
title: staticmethod and classmethod are ignored when disassemble class
Added file: 
http://bugs.python.org/file42429/add_staticmethod_and_classmethod_when_dis.dis_a_class.patch

___
Python tracker 

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