Re: [Python-Dev] PEPs: ``.. code:: python`` or ``::`` (syntax highlighting)

2017-12-02 Thread Serhiy Storchaka

30.11.17 15:00, Wes Turner пише:

In ReStructuredText, this gets syntax highlighted
because of the code directive [1][2][3]:

.. code:: python

    import this
    def func(*args, **kwargs):
        pass

This also gets syntax highlighted as python[3]:

.. code:: python

    import this
    def func(*args, **kwargs):
        pass

This does not::

    import this
    def func(*args, **kwargs):
        pass

Syntax highlighting in Docutils 0.9+ is powered by Pygments.
If Pygments is not installed, or there is a syntax error,
syntax highlighting is absent.

GitHub does show Pygments syntax highlighting
in .. code:: blocks for .rst and .restructuredtext documents [4]

1. Does the python.org  PEP view support .. code:: 
blocks? [5]

2. Syntax highlighting is an advantage for writers, editors, and readers.
3. Should PEPs use .. code:: blocks to provide this advantage?


This was discussed when PEPs were converted to the .rst format. At that 
time this didn't work. I'm sure there is an open issue about adding 
support of Pygments. If this isn't, open the one.


___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEPs: ``.. code:: python`` or ``::`` (syntax highlighting)

2017-12-02 Thread Wes Turner
Add pygments for ``.. code::`` directive PEP syntax highlighting #1206
https://github.com/python/pythondotorg/issues/1206

Syntax highlighting is an advantage for writers, editors, and readers.

reStructuredText PEPs are rendered into HTML with docutils. Syntax
highlighting in Docutils 0.9+ is powered by Pygments. If Pygments is not
installed, or there is a syntax error, syntax highlighting is absent.
Docutils renders ``.. code::`` blocks with Python syntax highlighting by
default. You can specify ``.. code:: python`` or ``.. code:: python3``.

- GitHub shows Pygments syntax highlighting
for ``.. code::`` directives for .rst and .restructuredtext documents
- PEPs may eventually be hosted on ReadTheDocs with Sphinx (which installs
docutils and pygments as install_requires in setup.py).
  https://github.com/python/peps/issues/2
  https://github.com/python/core-workflow/issues/5

In order to use pygments with pythondotorg-hosted PEPs, a few things need
to happen:

- [ ] Include ``pygments`` in ``base-requirements.txt``
- [ ] Pick a pygments theme
  - Should we use the sphinx_rtd_theme default for consistency with the
eventual RTD-hosted PEPs?
- [ ] Include the necessary pygments CSS in the PEPs django template
- [ ] rebuild the PEPs
- Start using code directives in new PEPs
- Manually review existing PEPs after adding code directives

PEPs may use ``.. code::`` blocks instead of ``::`` so that code is syntax
highlighted.

On Saturday, December 2, 2017, Nick Coghlan  wrote:

> On 3 December 2017 at 12:32, Wes Turner  > wrote:
> > Pending a transition of PEPs to ReadTheDocs (with HTTPS on a custom
> domain?
> > and redirects?) (is there a gh issue for this task?),
>
> See https://github.com/python/peps/projects/1 and
> https://github.com/python/core-workflow/issues/5
>
> Cheers,
> Nick.
>
> --
> Nick Coghlan   |   ncogh...@gmail.com    |   Brisbane,
> Australia
>
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEPs: ``.. code:: python`` or ``::`` (syntax highlighting)

2017-12-02 Thread Nick Coghlan
On 3 December 2017 at 12:32, Wes Turner  wrote:
> Pending a transition of PEPs to ReadTheDocs (with HTTPS on a custom domain?
> and redirects?) (is there a gh issue for this task?),

See https://github.com/python/peps/projects/1 and
https://github.com/python/core-workflow/issues/5

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] What's the status of PEP 505: None-aware operators?

2017-12-02 Thread Nick Coghlan
On 2 December 2017 at 12:01, Steven D'Aprano  wrote:
> The PEP only mentions function?() as a rejected idea, do I don't know
> why we're even talking about it. The PEP is deferred, with considerable
> opposition and luke-warm support, even the PEP author has said he's not
> going to push for it, and we're arguing about a pedantic point related
> to a part of the PEP which is rejected...

Nevertheless, I've fixed the rationale for that decision so folks
don't get hung up on the mistake in the previously noted rationale:
https://github.com/python/peps/commit/966dd426787e6de8ec6218955cec57f65086c5b4

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEPs: ``.. code:: python`` or ``::`` (syntax highlighting)

2017-12-02 Thread Wes Turner
Pending a transition of PEPs to ReadTheDocs (with HTTPS on a custom domain?
and redirects?) (is there a gh issue for this task?),
for the pythondotorg project
is it as simple as `pip install pygments` and rebuilding each .rst with
docutils with pygments installed?

On Saturday, December 2, 2017, Mariatta Wijaya 
wrote:

> If we were to add Pygments support, it is to be done in pythondotorg
> project.
>
> I recalled the decision was to get PEPs rendered using Sphinx and host it
> at Read The Docs, so we don't have to worry about updating pythondotorg.
>
> Mariatta Wijaya
>
>
>
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Third and hopefully final post: PEP 557, Data Classes

2017-12-02 Thread Nick Coghlan
On 2 December 2017 at 08:15, Eric V. Smith  wrote:
> See https://github.com/ericvsmith/dataclasses/issues/104 for a discussion on
> making order=False the default. This matches regular classes in Python 3,
> which cannot be ordered.

+1 for making "order=True" be explicitly opt-in.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEPs: ``.. code:: python`` or ``::`` (syntaxhighlighting)

2017-12-02 Thread Mariatta Wijaya
If we were to add Pygments support, it is to be done in pythondotorg
project.

I recalled the decision was to get PEPs rendered using Sphinx and host it
at Read The Docs, so we don't have to worry about updating pythondotorg.

Mariatta Wijaya
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEPs: ``.. code:: python`` or ``::`` (syntaxhighlighting)

2017-12-02 Thread Steve Dower
I tried using code blocks while writing PEP 551 but they weren’t highlighted on 
the python.org rendering.

Personally I think it would be great, provided a good colour scheme is 
available (some default schemes are... not always works of art). I’m not sure 
who is responsible for that side of things though – presumably it’s just a case 
of installing pygments. (FWIW, I’m not keen on going back and modifying old 
PEPs, but I won’t stop someone doing it on their own terms.)

Cheers,
Steve

Top-posted from my Windows phone at North Bay Python

From: Wes Turner
Sent: Thursday, November 30, 2017 5:06
To: Python-Dev
Subject: [Python-Dev] PEPs: ``.. code:: python`` or ``::`` (syntaxhighlighting)

In ReStructuredText, this gets syntax highlighted
because of the code directive [1][2][3]:

.. code:: python

   import this
   def func(*args, **kwargs):
       pass

This also gets syntax highlighted as python[3]:

.. code:: python

   import this
   def func(*args, **kwargs):
       pass

This does not::

   import this
   def func(*args, **kwargs):
       pass

Syntax highlighting in Docutils 0.9+ is powered by Pygments.
If Pygments is not installed, or there is a syntax error,
syntax highlighting is absent.

GitHub does show Pygments syntax highlighting
in .. code:: blocks for .rst and .restructuredtext documents [4]

1. Does the python.org PEP view support .. code:: blocks? [5]
2. Syntax highlighting is an advantage for writers, editors, and readers.
3. Should PEPs use .. code:: blocks to provide this advantage?

[1] http://docutils.sourceforge.net/docs/ref/rst/directives.html#code
[2] http://www.sphinx-doc.org/en/stable/markup/code.html
[3] http://www.sphinx-doc.org/en/stable/config.html#confval-highlight_language
[4] https://github.com/python/peps/blob/master/pep-0557.rst
[5] https://www.python.org/dev/peps/pep-0557/

https://www.python.org/dev/peps/pep-0458/

___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] PEP 557 Data Classes 5th posting

2017-12-02 Thread Eric V. Smith
I've pushed another version of PEP 557. The only difference is changing 
the default value of "order" to False instead of True. This matches 
regular classes: instances can be tested for equality, but are unordered.


Discussion at https://github.com/ericvsmith/dataclasses/issues/104

It's already available at https://www.python.org/dev/peps/pep-0557/

I've updated the implementation on PyPI to reflect this change: 
https://pypi.python.org/pypi/dataclasses/0.3


Eric.
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com