[issue13387] suggest assertIs(type(obj), cls) for exact type checking

2011-12-18 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- resolution: - fixed stage: commit review - committed/rejected status: open - closed type: behavior - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13387

[issue13387] suggest assertIs(type(obj), cls) for exact type checking

2011-12-18 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 88aacd3541ae by Ezio Melotti in branch '2.7': #13387: rephrase unclear sentence. http://hg.python.org/cpython/rev/88aacd3541ae New changeset eccb4795767b by Ezio Melotti in branch '3.2': #13387: rephrase unclear

[issue13387] suggest assertIs(type(obj), cls) for exact type checking

2011-11-21 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Your latest proposal is better. I would prefer mentioning subclasses, but don’t feel strongly about it. One markup nit: I’d use ``code`` instead of (ab)using :func:; the doc for assertIs is just a few paragraphs above, it won’t be hard to

[issue13387] suggest assertIs(type(obj), cls) for exact type checking

2011-11-20 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: No, I’m not talking about a rephrasing, but on a full change of meaning. I don’t understand your use of “superclasses” at all; isinstance(x, T) checks if x is an instance of T or any subclass, am I wrong? --

[issue13387] suggest assertIs(type(obj), cls) for exact type checking

2011-11-20 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Is To check for the exact type, use :func:`assertIs(type(obj), cls) assertIs`. better? I think the problem this solves is clear enough even without mentioning sub/superclasses. -- ___ Python

[issue13387] suggest assertIs(type(obj), cls) for exact type checking

2011-11-18 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Fixed. -- assignee: docs@python - ezio.melotti resolution: - fixed stage: needs patch - committed/rejected status: open - closed versions: +Python 2.7, Python 3.2 ___ Python tracker

[issue13387] suggest assertIs(type(obj), cls) for exact type checking

2011-11-18 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset fd9d7a8e45bc by Ezio Melotti in branch '2.7': #13387: add note about checking the exact type in assertIsInstance doc. http://hg.python.org/cpython/rev/fd9d7a8e45bc New changeset 583aff635ce1 by Ezio Melotti in

[issue13387] suggest assertIs(type(obj), cls) for exact type checking

2011-11-18 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: + To check for a specific type (without including superclasses) use + :func:`assertIs(type(obj), cls) assertIs`. Don’t you mean “without accepting subclasses”, not superclasses? -- ___ Python tracker

[issue13387] suggest assertIs(type(obj), cls) for exact type checking

2011-11-18 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: + To check for a specific type (without including superclasses) use + :func:`assertIs(type(obj), cls) assertIs`. Don’t you mean “without accepting subclasses”, not superclasses? I mean: class MyInt(int): pass # my specific type ...

[issue13387] suggest assertIs(type(obj), cls) for exact type checking

2011-11-12 Thread Florent Xicluna
Florent Xicluna florent.xicl...@gmail.com added the comment: +1 on a doc addition (I can even volunteer a patch) I agree we can highlight the difference between assertIs(type(obj), cls) and assertIsInstance(obj, cls) in the documentation. Let's forget this patch and keep it simple.