[issue11470] Flag inappropriate uses of callable class attributes

2017-05-22 Thread Thomas Wouters

Changes by Thomas Wouters :


--
resolution:  -> out of date
stage:  -> 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



[issue11470] Flag inappropriate uses of callable class attributes

2014-07-10 Thread Mark Lawrence

Mark Lawrence added the comment:

This issue is referred to from #11455.

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue11470] Flag inappropriate uses of callable class attributes

2013-06-04 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue11470] Flag inappropriate uses of callable class attributes

2013-02-25 Thread Ulrich Eckhardt

Changes by Ulrich Eckhardt :


--
nosy: +eckhardt

___
Python tracker 

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



[issue11470] Flag inappropriate uses of callable class attributes

2011-07-13 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +ericsnow

___
Python tracker 

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



[issue11470] Flag inappropriate uses of callable class attributes

2011-07-13 Thread Éric Araujo

Éric Araujo  added the comment:

Hi Thomas, could you give us a status update?  Maybe I can help with tests or 
docs?

--

___
Python tracker 

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



[issue11470] Flag inappropriate uses of callable class attributes

2011-03-17 Thread Thomas Wouters

Changes by Thomas Wouters :


Removed file: http://bugs.python.org/file21088/nonmethod-warn-nongit.diff

___
Python tracker 

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



[issue11470] Flag inappropriate uses of callable class attributes

2011-03-17 Thread Thomas Wouters

Thomas Wouters  added the comment:

New version of the patch; instead of triggering at attribute *access*, this 
just checks when creating types and in type_setattro. It also makes the warning 
a newly added CompatibilityWarning. Also, instead of warning for all 
non-descriptors, it now only warns for PyCFunctionObjects that do not have a 
__self__ set, or of which __self__ is a module. (The reason for the latter 
being the new-ish behaviour of functions defined in modules in C getting passed 
something as __self__, defaulting to the module.) I've removed a few 
staticmethod calls from cases that do not trigger the new warning.

This patch still lacks tests and doc updates, but I'm uploading right now 
because the sprints apparently lose internet soonish.

--
Added file: http://bugs.python.org/file21271/nonmethod-warn.diff

___
Python tracker 

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



[issue11470] Flag inappropriate uses of callable class attributes

2011-03-11 Thread Guido van Rossum

Guido van Rossum  added the comment:

This should not reuse DeprecationWarning but instead introduce a different 
warning, e.g. CompatibilityWarning.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue11470] Flag inappropriate uses of callable class attributes

2011-03-11 Thread Thomas Wouters

Changes by Thomas Wouters :


Removed file: http://bugs.python.org/file21087/nonmethod-warn-nongit.diff

___
Python tracker 

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



[issue11470] Flag inappropriate uses of callable class attributes

2011-03-11 Thread Thomas Wouters

Changes by Thomas Wouters :


Added file: http://bugs.python.org/file21088/nonmethod-warn-nongit.diff

___
Python tracker 

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



[issue11470] Flag inappropriate uses of callable class attributes

2011-03-11 Thread Éric Araujo

Éric Araujo  added the comment:

Don’t forget to remove the comments in codecs that are made obsolete by your 
changes.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue11470] Flag inappropriate uses of callable class attributes

2011-03-11 Thread Thomas Wouters

Changes by Thomas Wouters :


Removed file: http://bugs.python.org/file21085/nonmethod-warn.diff

___
Python tracker 

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



[issue11470] Flag inappropriate uses of callable class attributes

2011-03-11 Thread Thomas Wouters

Changes by Thomas Wouters :


Added file: http://bugs.python.org/file21087/nonmethod-warn-nongit.diff

___
Python tracker 

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



[issue11470] Flag inappropriate uses of callable class attributes

2011-03-11 Thread Daniel Urban

Changes by Daniel Urban :


--
nosy: +durban

___
Python tracker 

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



[issue11470] Flag inappropriate uses of callable class attributes

2011-03-11 Thread Alex

Changes by Alex :


--
nosy: +alex

___
Python tracker 

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



[issue11470] Flag inappropriate uses of callable class attributes

2011-03-11 Thread Andreas Stührk

Changes by Andreas Stührk :


--
nosy: +Trundle

___
Python tracker 

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



[issue11470] Flag inappropriate uses of callable class attributes

2011-03-11 Thread Thomas Wouters

New submission from Thomas Wouters :

As discussed at the language summit at PyCon 2011, some code takes some 
liberties with setting class attributes to callable objects, like CFunctions, 
that (C)Python does not turn into methods. This is problematic because 1) 
CPython can't then turn that CFunction into a regular function, and 2) other 
implementations have to specialcase the builtins to emulate the behaviour.

This patch adds a warning when a non-descriptor, non-class callable attribute 
is accessed in a context that would have fired the descriptor. It also fixes a 
bunch of these warnings that show up when running the testsuite. Some of these 
warnings are obviously (to me) incorrect code  -- like the io testsuite, which 
uses staticmethod around pyio.open but not io.open, or the encoding classes 
that use an encode function from an extension module as a class attribute. Some 
of the warnings are debatable, but have an obvious fix (wrap in staticmethod.) 
Some could be considered false-positives because they actually use (what 
amounts to) a a bound instance method as a class attribute (for example, 
re.compile('...').match.)

The patch is still a work in progress, I'm just uploading to start the 
discussion sooner rather than later.

--
components: Interpreter Core
files: nonmethod-warn.diff
keywords: patch
messages: 130606
nosy: twouters
priority: normal
severity: normal
status: open
title: Flag inappropriate uses of callable class attributes
type: feature request
versions: Python 3.3
Added file: http://bugs.python.org/file21085/nonmethod-warn.diff

___
Python tracker 

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