[issue30096] Update examples in abc documentation to use abc.ABC

2017-09-15 Thread Éric Araujo
Éric Araujo added the comment: Keyword arguments in a class definition are supported: https://www.python.org/dev/peps/pep-3115/#specification Anyway, this ticket is closed, a mailing list such as python-ideas would be a better venue to discuss base classes vs metaclasses in a general way.

[issue30096] Update examples in abc documentation to use abc.ABC

2017-09-14 Thread Vedran Čačić
Vedran Čačić added the comment: Well, actually, Raymond was proposing an alternative to Py2's special __metaclass__ attribute assignment syntax, which honestly _is_ an abomination (and the big part of reason why that was changed in Py3 to a keyword argument in a class definition). And Guido

[issue30096] Update examples in abc documentation to use abc.ABC

2017-09-14 Thread Éric Araujo
Éric Araujo added the comment: > "Best practices" according to whom? Well at least two senior core developers :) See the rationale in #16049 when abc.ABC was first added (with Guido approving that inheritance is nicer for most people). -- ___

[issue30096] Update examples in abc documentation to use abc.ABC

2017-09-07 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Backported to 3.6 by Miss Islington. Closing this issue. Thanks. -- resolution: -> fixed stage: backport needed -> resolved status: open -> closed ___ Python tracker

[issue30096] Update examples in abc documentation to use abc.ABC

2017-09-07 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: New changeset b0d0217c0e4c1512a06ef306928b2fd8f82d046e by Mariatta (Miss Islington (bot)) in branch '3.6': [3.6] bpo-30096: Use ABC in abc reference examples (GH-1220) (GH-3408) https://github.com/python/cpython/commit/b0d0217c0e4c1512a06ef306928b2fd8f82d046e

[issue30096] Update examples in abc documentation to use abc.ABC

2017-09-06 Thread Vedran Čačić
Vedran Čačić added the comment: "Best practices" according to whom? Inheritance is one thing, metaclass changing is another thing. They should look different. Yes, I appreciate the fact that I can write "(Blah)" instead of "(metaclass=BlahMeta)" in quick and dirty scripts, but my feeling is

[issue30096] Update examples in abc documentation to use abc.ABC

2017-09-06 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +3409 ___ Python tracker ___

[issue30096] Update examples in abc documentation to use abc.ABC

2017-08-30 Thread Éric Araujo
Éric Araujo added the comment: Thanks for the patch! Raymond approved it and I merged it after a minor change. Now let me read the doc again about backports :) -- stage: needs patch -> backport needed versions: +Python 3.6 ___ Python tracker

[issue30096] Update examples in abc documentation to use abc.ABC

2017-08-30 Thread Éric Araujo
Éric Araujo added the comment: New changeset 122e88a8354e3f75aeaf6211232dac88ac296d54 by Éric Araujo (Eric Appelt) in branch 'master': bpo-30096: Use ABC in abc reference examples (#1220) https://github.com/python/cpython/commit/122e88a8354e3f75aeaf6211232dac88ac296d54 -- nosy:

[issue30096] Update examples in abc documentation to use abc.ABC

2017-04-20 Thread Eric Appelt
Eric Appelt added the comment: I created a PR to update the documentation to use this pattern and follow Raymond's suggestion of showing both ways to define an abc. In order to make the examples comprehensible when read from beginning to end, I reordered the classes so that abc.ABC is

[issue30096] Update examples in abc documentation to use abc.ABC

2017-04-20 Thread Eric Appelt
Changes by Eric Appelt : -- pull_requests: +1343 ___ Python tracker ___ ___

[issue30096] Update examples in abc documentation to use abc.ABC

2017-04-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 It would be nice to have the examples show the usual best practices. That said, in the doc for abc.ABC itself, it would be nice to show an brief example both ways (much like we do for the property() docstring) to show the relationship between the two.

[issue30096] Update examples in abc documentation to use abc.ABC

2017-04-18 Thread Brett Cannon
New submission from Brett Cannon: I noticed that the documentation for the abc module (https://docs.python.org/3/library/abc.html) has all example classes use ABCMeta instead of ABC which is what most people probably want. To keep things simple the docs should probably be updated to inherit