Re: [Python-Dev] [Python-checkins] cpython: Eric Snow's implementation of PEP 421.
Thanks for the second set of eyes, Brett. On Jun 04, 2012, at 10:16 AM, Brett Cannon wrote:
+.. data:: implementation + + An object containing the information about the implementation of the + currently running Python interpreter. Its attributes are the those
"the those" -> "those"
I actually rewrote this section a bit: An object containing information about the implementation of the currently running Python interpreter. The following attributes are required to exist in all Python implementations.
+ that all Python implementations must implement.
Should you mention that VMs are allowed to add their own attributes that are not listed?
Here's how I rewrote it: :data:`sys.implementation` may contain additional attributes specific to the Python implementation. These non-standard attributes must start with an underscore, and are not described here. Regardless of its contents, :data:`sys.implementation` will not change during a run of the interpreter, nor between implementation versions. (It may change between Python language versions, however.) See `PEP 421` for more information.
They are described + below. + + *name* is the implementation's identifier, like ``'cpython'``.
Is this guaranteed to be lowercase, or does it simply happen to be lowercase in this instance?
Yes, PEP 421 guarantees them to be lower cased. *name* is the implementation's identifier, e.g. ``'cpython'``. The actual string is defined by the Python implementation, but it is guaranteed to be lower case.
I think you meant to say ``sys.version_info(2, 7, 2, 'final', 0)``.
Fixed.
+ However, for a structured record type use :func:`~collections.namedtuple`
What's with the ~?
I'm not sure, but it seems to result in a cross-reference, and I see tildes used elsewhere, so I guess it's some reST/docutils magic. I left this one in there. Cheers, -Barry
On 4 Jun 2012, at 16:10, Barry Warsaw wrote:
[snip...]
+ However, for a structured record type use :func:`~collections.namedtuple`
What's with the ~?
I'm not sure, but it seems to result in a cross-reference, and I see tildes used elsewhere, so I guess it's some reST/docutils magic. I left this one in there.
It means display the link with the text "namedtuple" instead of the full "collections.namedtuple". You can't just omit the "collections" as Sphinx needs to know where to find the link target. Michael
Cheers, -Barry _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.u...
-- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html
On Mon, Jun 4, 2012 at 11:10 AM, Barry Warsaw
Thanks for the second set of eyes, Brett.
On Jun 04, 2012, at 10:16 AM, Brett Cannon wrote:
+.. data:: implementation + + An object containing the information about the implementation of the + currently running Python interpreter. Its attributes are the those
"the those" -> "those"
I actually rewrote this section a bit:
An object containing information about the implementation of the currently running Python interpreter. The following attributes are required to exist in all Python implementations.
+ that all Python implementations must implement.
Should you mention that VMs are allowed to add their own attributes that are not listed?
Here's how I rewrote it:
:data:`sys.implementation` may contain additional attributes specific to the Python implementation. These non-standard attributes must start with an underscore, and are not described here. Regardless of its contents, :data:`sys.implementation` will not change during a run of the interpreter, nor between implementation versions. (It may change between Python language versions, however.) See `PEP 421` for more information.
They are described + below. + + *name* is the implementation's identifier, like ``'cpython'``.
Is this guaranteed to be lowercase, or does it simply happen to be lowercase in this instance?
Yes, PEP 421 guarantees them to be lower cased.
*name* is the implementation's identifier, e.g. ``'cpython'``. The actual string is defined by the Python implementation, but it is guaranteed to be lower case.
OK, then I would add a test to make sure this happens, like ``self.assertEqual(sys.implementation.name, sys.implement.name.lower())`` if you don't want to bother documenting it to make sure other VMs conform. -Brett
I think you meant to say ``sys.version_info(2, 7, 2, 'final', 0)``.
Fixed.
+ However, for a structured record type use :func:`~collections.namedtuple`
What's with the ~?
I'm not sure, but it seems to result in a cross-reference, and I see tildes used elsewhere, so I guess it's some reST/docutils magic. I left this one in there.
Cheers, -Barry
On Jun 04, 2012, at 11:39 AM, Brett Cannon wrote:
OK, then I would add a test to make sure this happens, like ``self.assertEqual(sys.implementation.name, sys.implement.name.lower())`` if you don't want to bother documenting it to make sure other VMs conform.
Good idea. Done. -Barry
participants (3)
-
Barry Warsaw
-
Brett Cannon
-
Michael Foord