[issue9731] Add ABCMeta.has_methods and tests that use it

2018-11-06 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2018-11-05 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests:  -9633

___
Python tracker 

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2018-11-05 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2018-11-04 Thread Jonathan Gossage


Change by Jonathan Gossage :


--
pull_requests: +9633

___
Python tracker 

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2015-04-14 Thread Laura Rupprecht

Laura Rupprecht added the comment:

Related item: Added a helper function to verify API match of two modules, 
addressing issue9859.

It checks for a closer match but mentioned this ticket from the thread.

--
nosy: +laura

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2015-03-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What if abstract class contains not only abstract methods, but default 
implementation of some methods? Should the predicate test if tested class 
contain these methods?

For example, the Sequence ABC contains default implementation of __iter__. 
Should the predicate test that concrete sequence class implements __iter__?

--
nosy: +serhiy.storchaka

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2014-08-25 Thread Claudiu Popa

Changes by Claudiu Popa pcmantic...@gmail.com:


--
stage: needs patch - patch review

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2014-06-28 Thread Mark Lawrence

Mark Lawrence added the comment:

Can we have a formal patch review with a view to committing as this issue is 
referenced from #9859.

--
nosy: +BreamoreBoy

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2014-04-24 Thread Claudiu.Popa

Claudiu.Popa added the comment:

I have updated the previous patch, by documenting the new class method.

--
versions: +Python 3.5 -Python 3.4
Added file: http://bugs.python.org/file35027/issue9731.patch

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2013-11-17 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Hello! Here's a preliminary implementation, with tests for collections ABC. It 
doesn't have any docs yet, though. I chose the name verify_full_api, but I'm ok 
with check_methods as well.

--
keywords: +patch
nosy: +Claudiu.Popa
versions: +Python 3.4 -Python 3.2
Added file: http://bugs.python.org/file32666/abc_9731.patch

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2010-09-04 Thread Daniel Urban

Changes by Daniel Urban urban.dani...@gmail.com:


--
nosy: +durban

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2010-09-03 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

Good idea!

I see Raymond's point about the name. How about .method_check?
To me Sequence.method_check(range) means Abstract Seqeunce class, please 
method-check the concrete range class.

If Sequence.register(range) is in the range source file, I would expect to find 
the test of the range class in test_range.

If all collection registrations were bundled together in collections.py, I 
think I would expect the tests to be in test_collections. But I could still be 
presuaded that the range method check should be in test_range where all the 
individual methods are (should be!) tested.

--
nosy: +terry.reedy

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2010-09-03 Thread Daniel Stutzbach

Daniel Stutzbach dan...@stutzbachenterprises.com added the comment:

I agree that my original name proposal is terrible. :-)  method_check and 
verify_full_api both look fine to me.

 If all collection registrations were bundled together in 
 collections.py, I think I would expect the tests to be in 
 test_collections. But I could still be presuaded that the range method
 check should be in test_range where all the individual methods are 
 (should be!) tested.

All of the registrations are bundled together in _abcoll.py, which 
collections.py imports into collections.py's namespace.  (It's in a separate 
file to get around some bootstrapping issues.)

I favor putting them in test_collections to make it slightly easier to check 
for a 1:1 correlation between registrations and tests, but it's not something I 
feel strongly about.

--

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2010-09-03 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

I wanted to propose the name check_methods, but then I thought that some people 
could read too much in that name, for example that arguments and return value 
are checked for correct type and value (see how Web people misunderstand “HTML 
validation”). That said, “check” promises less than “validate”, and ABCs being 
a middle-to-advanced topic, we could trust people using this method to read the 
docstring and not expect too much.

--

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2010-09-01 Thread Daniel Stutzbach

Daniel Stutzbach dan...@stutzbachenterprises.com added the comment:

Re-opening and re-titling the issue to that effect.

Proposed syntax and usage:

# in Lib/abc.py
class ABCMeta(type):
# ...

def has_methods(cls, subclass):
Returns True iff subclass implements the appropriate methods
# ...

Usage within the unit tests:

# In Lib/test/test_collections.py
def test_methods(self):
self.assertTrue(Sequence.has_methods(range))
self.assertTrue(MutableSet.has_methods(set))
# ... and many more

--
assignee:  - stutzbach
components: +Tests
resolution: rejected - accepted
stage:  - needs patch
status: closed - open
title: ABCMeta.register should verify that methods are present - Add 
ABCMeta.has_methods and tests that use it

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2010-09-01 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

+1 for the basic idea.

It could use a better name, Sequence.has_methods(range) reads backwards to me.  
Perhaps something like:  Sequence.implemented_by(range) or 
Sequence.verify_full_api(range) or some such.

Also, when the tests get added, they should go in the test file for the 
implementing class (like test_range for example.)

--
nosy: +rhettinger

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