Re: [Python-Dev] Dash

2013-07-22 Thread Serhiy Storchaka

I have opened an issue (http://bugs.python.org/issue18529) for patches.

___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-20 Thread Serhiy Storchaka

19.07.13 22:32, Ben Finney написав(ла):

Serhiy Storchaka storch...@gmail.com writes:

I'm asking only about this case, when the dash is used to denote a
break in a sentence or to set off parenthetical statements.


That's two separate cases:

* denote a break in a sentence
* set off parenthetical statements


In Wikipedia they considered as one case.


In my experience, an em dash is commonly used for the former, and en
dashes commonly used for the latter. Using the same dash for both is
unusual (and IMO needlessly ambiguous to the reader).


This is definitely should be described in the official guide. I never 
heard about this.



Currently Python documentation uses fourth variants:


All your examples are only for parenthetical statements. Can you find
examples of the former, where a break (not parenthetical) in the
sentence is intended?


(2) and (4) are from Wikipedia (which consider it as one case). Here are 
real random examples from Python documentation:


1. Common installation tools such as ``Distribute`` and ``pip`` work as 
expected with venvs - i.e. when a venv is active, they install Python 
packages into the venv without needing to be told to do so explicitly.


2. Enter *string* in the table of interned strings and return the 
interned string which is *string* itself or a copy.


3. The :class:`set` type is mutable --- the contents can be changed 
using methods like :meth:`add` and :meth:`remove`.


4. Three locking mechanisms are used---dot locking and, if available, 
the :c:func:`flock` and :c:func:`lockf` system calls.



___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-19 Thread Ben Finney
Serhiy Storchaka storch...@gmail.com writes:

 What type of dash is preferable in the documentation? The en dash (–)
 or the em dash (—)?

They have different purposes; use whichever is appropriate for the
context.

This isn't an official Python developer position. But all of ‘-’, ‘–’,
‘—’, ‘−’, etc. have distinct and common meanings in English text. So
it's a mistaken idea to think of “which dash is preferable” since they
are *all* preferable for their distinct uses.

-- 
 \“Science doesn't work by vote and it doesn't work by |
  `\authority.” —Richard Dawkins, _Big Mistake_ (The Guardian, |
_o__)  2006-12-27) |
Ben Finney

___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-19 Thread Nick Coghlan
On 19 July 2013 17:25, Ben Finney ben+pyt...@benfinney.id.au wrote:
 Serhiy Storchaka storch...@gmail.com writes:

 What type of dash is preferable in the documentation? The en dash (-)
 or the em dash (--)?

 They have different purposes; use whichever is appropriate for the
 context.

 This isn't an official Python developer position. But all of '-', '-',
 '--', '-', etc. have distinct and common meanings in English text. So
 it's a mistaken idea to think of which dash is preferable since they
 are *all* preferable for their distinct uses.

I don't know about common. I had no idea there were 3 dash types
until a couple of weeks ago. I thought there were only two
(short/hyphen/minus-sign and long/em-dash). I still don't really know
what the difference is between the two long ones (en-dash vs em-dash).

Cheers,
Nick.

--
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-19 Thread Antoine Pitrou
Le Fri, 19 Jul 2013 18:38:05 +1000,
Nick Coghlan ncogh...@gmail.com a écrit :
 On 19 July 2013 17:25, Ben Finney ben+pyt...@benfinney.id.au wrote:
  Serhiy Storchaka storch...@gmail.com writes:
 
  What type of dash is preferable in the documentation? The en dash
  (-) or the em dash (--)?
 
  They have different purposes; use whichever is appropriate for the
  context.
 
  This isn't an official Python developer position. But all of '-',
  '-', '--', '-', etc. have distinct and common meanings in English
  text. So it's a mistaken idea to think of which dash is
  preferable since they are *all* preferable for their distinct uses.
 
 I don't know about common. I had no idea there were 3 dash types
 until a couple of weeks ago. I thought there were only two
 (short/hyphen/minus-sign and long/em-dash). I still don't really know
 what the difference is between the two long ones (en-dash vs em-dash).

But there aren't 3 dash types. There are at least 5 of them!
https://en.wikipedia.org/wiki/Dash#Common_dashes

(not to mention that Twisted has/had its own dash, IIRC)

cheers

Antoine.


___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-19 Thread Steven D'Aprano

On 19/07/13 18:38, Nick Coghlan wrote:


I don't know about common. I had no idea there were 3 dash types


*Way* more than three.

hyphen
minus sign (not the same as a hyphen!)
en-dash
em-dash
two-em-dash
three-em-dash
figure dash
horizontal bar
swung dash

plus another half-dozen or so non-English hyphens, all of which have different 
typographic (and sometimes grammatical) purposes. Wikipedia has a good 
description:

https://en.wikipedia.org/wiki/Dash

but a brief summary is:

– hyphen - is the smallest and is used for compound words like out-tray;
– minus sign − is normally raised compared to the others;
– en-dash – should be the width of n and is used for ranges, like Mon–Fri;
– em-dash — should be the width of m and is used for a break stronger than a 
comma but weaker than a full stop;
– horizontal bar ― should be longer than the em-dash and is used for quotations 
in some European languages;
– swung dash ⁓ is normally found in dictionaries (paper, not Python) to stand 
in for the word being defined.


But of course different fonts follow these rules to a greater or lesser degree.



--
Steven
___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-19 Thread Serhiy Storchaka

18.07.13 21:54, Brian Curtin написав(ла):

Besides visual consistency in a couple of places, is there a reason to
care enough to make a wholesale change?


Single hyphen instead of a dash just looks too ugly to me.

Trying to fix this I noticed that the documentation is inconsistent 
regarding the dash. Sometimes en and em dashes meet in the same line and 
in the same sentence. I.e.:



The :mod:`weakref` module also allows creating proxy objects which 
behave like
weak references --- an object referenced only by proxy objects is 
deallocated --

but instead of requiring an explicit call to retrieve the object, the proxy



___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-19 Thread Serhiy Storchaka

18.07.13 21:55, Guido van Rossum написав(ла):

On Thu, Jul 18, 2013 at 11:46 AM, Serhiy Storchaka storch...@gmail.com wrote:

Or we should replace a half-dozen of em-dashes found in Python documentation
to en-dashes?


If my theory is right that makes sense. Especially if it's only a half-dozen.


I'm sorry, I were wrong. Actually em-dash used much more then en-dash in 
Python documentation.



___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-19 Thread Serhiy Storchaka

19.07.13 00:49, Ezio Melotti написав(ла):

On Thu, Jul 18, 2013 at 7:38 PM, Serhiy Storchaka storch...@gmail.com wrote:

What type of dash is preferable in the documentation? The en dash (–) or the
em dash (—)?



Both should be used where appropriate [0].


Of course I looked in Wikipedia before asking on this list. And I were 
surprised that en-dash allowed in same places as em-dashes:



Either version may be used to denote a break in a sentence or to set off 
parenthetical statements, although writers are generally cautioned to 
use a single form consistently within their work. In this function, en 
dashes are used with spaces and em dashes are used without them:[1]


[Em dash:] In matters of grave importance, style—not sincerity—is the 
vital thing.


[En dash:] In matters of grave importance, style – not sincerity – is 
the vital thing.



I'm asking only about this case, when the dash is used to denote a break 
in a sentence or to set off parenthetical statements. Currently Python 
documentation uses fourth variants:


1. A single hyphen - surrounded with spaces. In matters of grave 
importance, style - not sincerity - is the vital thing.
I think this case should be converted to one of followed, but to what of 
them?


2. A double hyphen -- (converted to en-dash) surrounded with spaces. 
In matters of grave importance, style -- not sincerity -- is the vital 
thing.


3. A triple hyphen --- (converted to em-dash) surrounded with spaces. 
In matters of grave importance, style --- not sincerity --- is the 
vital thing.


4. A triple hyphen --- (converted to em-dash) which isn't surrounded 
with spaces. In matters of grave importance, style---not sincerity---is 
the vital thing.



 The em dash is more
common, however -- (commonly used to indicate the em dash in e.g.
emails) gets converted to an en dash by Sphinx [1].  I noticed this a
while ago, and I started using --- in the documentation whenever I
wanted an em dash.


This is common in TeX.


___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-19 Thread Serhiy Storchaka

19.07.13 07:51, Steven D'Aprano написав(ла):

Optimistically, I think it would probably be safe[1] to replace  -- 
or  ---  in text with \N{THIN SPACE}\N{EM DASH}\N{THIN SPACE} (or
\N{HAIR SPACE} if you prefer) without human review, but for any other
changes, I wouldn't even try to automate it.


No, it is not safe.  --  used in code examples in which it doesn't 
converted to en-dash. Also we should correct tables and underlines in 
titles.


I have a manually written and multiple times checked patch (modifies 
about 640 lines) which safely replaces  --  with  ---  but I doubt 
what actually should be a preferable dash.


___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-19 Thread Ben Finney
Serhiy Storchaka storch...@gmail.com writes:

 19.07.13 10:25, Ben Finney написав(ла):
  Serhiy Storchaka storch...@gmail.com writes:
  What type of dash is preferable in the documentation? The en dash
  (–) or the em dash (—)?
 
  They have different purposes; use whichever is appropriate for the
  context.

 I mean only a context where a dash is used to denote a break in a
 sentence or to set off parenthetical statements.

Yes, and both of those are used for different purposes, so “what type is
preferable (for all the purposes you mention)” is a poor way of looking
at it, IMO.

Local style guides have rules about when and how to use the different
dashes for specific contexts.

(For myself, I prefer parenthetic dashes to be en dashes ‘–’, and a
break in a sentence to be marked by an em dash ‘—’. But I also prefer to
surround the dash with space for the latter purpose, so my preference
isn't universal.)

Wikipedia's article (already referred) discusses the matter fairly well
URL:https://en.wikipedia.org/wiki/Dashes.

 Currently Python documentation uses four different variants (see my
 answer to Ezio).

I'd recommend that the Python documentation BDFL should choose and
dictate an existing well-groomed style guide for Python documentation,
preferably one which explicitly talks about when to use each of the
commonly-used dashes.

-- 
 \“If you have the facts on your side, pound the facts. If you |
  `\ have the law on your side, pound the law. If you have neither |
_o__)   on your side, pound the table.” —anonymous |
Ben Finney

___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-19 Thread Ben Finney
Serhiy Storchaka storch...@gmail.com writes:

 I'm sorry, I were wrong. Actually em-dash used much more then en-dash
 in Python documentation.

But, as you've also discovered, many authors will type two hyphens “--”
when they want an em dash “—”, yet this is rendered to an en dash “–”.
So the prevalence of the latter in the documentation probably does not
reflect the preferences of the authors.

-- 
 \ “Nature hath given men one tongue but two ears, that we may |
  `\  hear from others twice as much as we speak.” —Epictetus, |
_o__)  _Fragments_ |
Ben Finney

___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-19 Thread Ben Finney
Serhiy Storchaka storch...@gmail.com writes:

 I'm asking only about this case, when the dash is used to denote a
 break in a sentence or to set off parenthetical statements.

That's two separate cases:

* denote a break in a sentence
* set off parenthetical statements

In my experience, an em dash is commonly used for the former, and en
dashes commonly used for the latter. Using the same dash for both is
unusual (and IMO needlessly ambiguous to the reader).

 Currently Python documentation uses fourth variants:

All your examples are only for parenthetical statements. Can you find
examples of the former, where a break (not parenthetical) in the
sentence is intended?

-- 
 \ “When I was a kid I used to pray every night for a new bicycle. |
  `\Then I realised that the Lord doesn't work that way so I stole |
_o__)   one and asked Him to forgive me.” —Emo Philips |
Ben Finney

___
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/archive%40mail-archive.com


[Python-Dev] Dash

2013-07-18 Thread Serhiy Storchaka
What type of dash is preferable in the documentation? The en dash (–) or 
the em dash (—)?


___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-18 Thread Guido van Rossum
I believe there are only a few places where en-dashes should be used,
for most things you should use either em-dash or hyphen. Consult your
trusted typography source (for US English, please, punctuation
preferences vary by locale). E.g. Google for em dash en dash.

On Thu, Jul 18, 2013 at 10:38 AM, Serhiy Storchaka storch...@gmail.com wrote:
 What type of dash is preferable in the documentation? The en dash (–) or the
 em dash (—)?

-- 
--Guido van Rossum (python.org/~guido)
___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-18 Thread Serhiy Storchaka

18.07.13 20:48, Guido van Rossum написав(ла):

I believe there are only a few places where en-dashes should be used,
for most things you should use either em-dash or hyphen. Consult your
trusted typography source (for US English, please, punctuation
preferences vary by locale). E.g. Google for em dash en dash.


Currently Python documentation in most cases uses en-dashes. Should we 
replace them to em-dashes? Should we remove spaces around dashes?


Or we should replace a half-dozen of em-dashes found in Python 
documentation to en-dashes?


I believe all hypens used in place of dash should be replaced to dash 
(but to en- or em- dash?) in any case.



___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-18 Thread Guido van Rossum
On Thu, Jul 18, 2013 at 11:46 AM, Serhiy Storchaka storch...@gmail.com wrote:
 18.07.13 20:48, Guido van Rossum написав(ла):

 I believe there are only a few places where en-dashes should be used,
 for most things you should use either em-dash or hyphen. Consult your
 trusted typography source (for US English, please, punctuation
 preferences vary by locale). E.g. Google for em dash en dash.


 Currently Python documentation in most cases uses en-dashes. Should we
 replace them to em-dashes? Should we remove spaces around dashes?

This may well be a relic from times when in typewritten text there
were really only two types of dashes: a short one, typed as a hyphen,
used for both hyphen and en-dash (and minus sign), and a long one,
typed as two hyphens, used for em-dash.

I suspect at some point the conversion to HTML or typeset text changed
so that two hyphens mean en-dash and three mean em-dash, and few
people noticed (and nobody really wants to type three hyphens except
for a handful of typographical nuts).

 Or we should replace a half-dozen of em-dashes found in Python documentation
 to en-dashes?

If my theory is right that makes sense. Especially if it's only a half-dozen.

 I believe all hypens used in place of dash should be replaced to dash (but
 to en- or em- dash?) in any case.

But I wouldn't go change hundreds of hyphens -- chances are that you
get bored reviewing the scripted automation you're using and break a
few places. I'd say there are more important things to fix in the docs
(like writing better overviews for many modules and classes). If we
have a writing guide for the Python docs it would be useful to add
something about dash types though. And if we don't have a writing
guide, perhaps it makes sense to start one?

-- 
--Guido van Rossum (python.org/~guido)
___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-18 Thread Richard Oudkerk

On 18/07/2013 7:55pm, Guido van Rossum wrote:

This may well be a relic from times when in typewritten text there
were really only two types of dashes: a short one, typed as a hyphen,
used for both hyphen and en-dash (and minus sign), and a long one,
typed as two hyphens, used for em-dash.

I suspect at some point the conversion to HTML or typeset text changed
so that two hyphens mean en-dash and three mean em-dash, and few
people noticed (and nobody really wants to type three hyphens except
for a handful of typographical nuts).


Weren't the docs originally done LaTeX?  In LaTeX -- is also an 
en-dash and --- is an em-dash.


--
Richard

___
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/archive%40mail-archive.com


Re: [Python-Dev] Dash

2013-07-18 Thread Guido van Rossum
On Thu, Jul 18, 2013 at 12:16 PM, Richard Oudkerk shibt...@gmail.com wrote:
 On 18/07/2013 7:55pm, Guido van Rossum wrote:

 This may well be a relic from times when in typewritten text there
 were really only two types of dashes: a short one, typed as a hyphen,
 used for both hyphen and en-dash (and minus sign), and a long one,
 typed as two hyphens, used for em-dash.

 I suspect at some point the conversion to HTML or typeset text changed
 so that two hyphens mean en-dash and three mean em-dash, and few
 people noticed (and nobody really wants to type three hyphens except
 for a handful of typographical nuts).


 Weren't the docs originally done LaTeX?  In LaTeX -- is also an en-dash
 and --- is an em-dash.

Right -- but I've been typing two hyphens to mean an em-dash all my life. :-)

-- 
--Guido van Rossum (python.org/~guido)
___
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/archive%40mail-archive.com