> On Jul 17, 2017, at 8:22 AM, Steve Holden <[email protected]> wrote:
>
> My only question is "what's a variable called _source doing in the public
> API?"
The convention for named tuple hnas been for all the methods and attributes to
be prefixed with an underscore so that the names won't conflict with field
names in the named tuple itself. For example, we want to allow
Path=namedtuple('Path', ['source', 'destination']).
If I had it all to do over again, it might have been better to have had a
different convention like source_ with a trailing underscore, but that ship
sailed long ago :-)
Raymond
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com