Re: [Python-Dev] Misc re.match() complaint

2013-07-18 Thread Ezio Melotti
Hi,

On Wed, Jul 17, 2013 at 6:15 AM, Stephen J. Turnbull  wrote:
>
> BTW, I suggest that Terry's usage of "string" (to mean "str or bytes"
> in 3.x, "unicode or str" in 2.x) be adopted, and Guido's "stringish"
> be given expanded meaning, including buffer objects.

"string" means "str", "bytes" means "bytes", "bytes-like object" means
"any object that supports the buffer protocol" [0] (including bytes).
"string and bytes-like object" includes all of them.
I don't think we need to introduce new terms.

Best Regards,
Ezio Melotti

[0]: http://docs.python.org/3/glossary.html#term-bytes-like-object

>  Then we can say
> informally that in searching and matching a target is a stringish, the
> pattern is a stringish (?) or compiled re, but the group method
> returns a string.
>
> Steve
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Misc re.match() complaint

2013-07-18 Thread Guido van Rossum
On Thu, Jul 18, 2013 at 6:15 AM, Ezio Melotti  wrote:
> I don't think we need to introduce new terms.
+1

-- 
--Guido van Rossum (python.org/~guido)
___
Python-Dev mailing list
[email protected]
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
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Fwd: Issue 1229 in nativeclient: Get Python to work under Native Client

2013-07-18 Thread anatoly techtonik
Does Python build system support cross-compiling? NaCl projects seems to
have problem with that. Just thought you might be interested to know about
it.



-- Forwarded message --
From: 
Date: Tue, Jul 16, 2013 at 9:24 PM
Subject: Re: Issue 1229 in nativeclient: Get Python to work under Native
Client
To: [email protected]


Updates:
Status: Fixed

Comment #8 on issue 1229 by [email protected]: Get Python to work under
Native Client
http://code.google.com/p/**nativeclient/issues/detail?id=**1229

This is done in naclports.  Sam Clegg added initial support for building
against nacl-glibc in https://code.google.com/p/**
naclports/source/detail?r=802
.

Sam found a way to work around the Python build's lack of support for
cross-compiling.  The workaround is to build a native "pgen" first and
inject it into the later cross-build.

Building Python with nacl-newlib and PNaCl is a work in progress:
https://codereview.chromium.**org/18112024/
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Misc re.match() complaint

2013-07-18 Thread Terry Reedy


On 7/18/2013 9:15 AM, Ezio Melotti wrote:

In 3.x


"string" means "str", "bytes" means "bytes", "bytes-like object" means
"any object that supports the buffer protocol" [0] (including bytes).
"string and bytes-like object" includes all of them.
I don't think we need to introduce new terms.


I agree. We just need to use them consistently, and update docs carried 
over without change from 2.x (like re doc), where 'string' meant 
'unicode or str (bytes)' or even 'unicode and bytes-like'.

___
Python-Dev mailing list
[email protected]
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  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
[email protected]
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
[email protected]
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 Brian Curtin
On Jul 18, 2013 1:46 PM, "Serhiy Storchaka"  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?
>
> 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.

Besides visual consistency in a couple of places, is there a reason to care
enough to make a wholesale change?
___
Python-Dev mailing list
[email protected]
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  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
[email protected]
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
[email protected]
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  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
[email protected]
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 Ezio Melotti
Hi,

On Thu, Jul 18, 2013 at 7:38 PM, Serhiy Storchaka  wrote:
> What type of dash is preferable in the documentation? The en dash (–) or the
> em dash (—)?
>

Both should be used where appropriate [0].  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.
If this is not documented it should be added to the "documenting" page
of the devguide, so that people start using the right ones and convert
the wrong ones when they come across them.

Best Regards,
Ezio Melotti

[0]: http://en.wikipedia.org/wiki/Dash
[1]: 
https://bitbucket.org/birkenfeld/sphinx/src/default/sphinx/util/smartypants.py#cl-261
___
Python-Dev mailing list
[email protected]
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 Steven D'Aprano

On 19/07/13 04:46, Serhiy Storchaka 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?

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.


It depends on the context, and I don't believe you could completely automate 
the process (at least not without using something that understands natural 
language, like NLTK, and probably not even then). I think it will require a 
human reader to review them, like any other style and grammar edit.

Wikipedia has a good overview which mostly agrees with my typesetting and style 
books:

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

Hyphens are commonly used for compound words, although in practice hyphenated words gradually lose the 
hyphen. E.g. we usually write "inbox" rather than "in-box", although we still write 
"in-tray". Hyphens are also used at the end of the line to break a word to the next line.

En-dashes are used for durations and ranges (sometimes with a thin space on either side, 
otherwise a regular space can be used). E.g. "October–December".

En-dash is also used when making a compound word from words which themselves are compound words, e.g. "The 
pre–World War II economy" joins "pre-" with "World War II", not just "World".

Em-dashes are used for parenthetical asides, or to indicate a break in speech 
or thought. They are often used when a comma is too weak and a period is too 
strong—a bit like a colon.

Different sources give different recommendations regarding spaces around 
dashes. The Chicago Manual of Style agrees with most British sources that 
em-dashes should never have spaces around them, but the New York Times style 
guide sets hair-spaces around them. Unusually for me, I tend to agree with the 
NY Times on this one. A regular space is usually too wide.

Many of these conventions are style conventions, rather than strictly grammatical. For example, 
although English grammar says we can use an en-dash to make ranges of numbers, the SI standard 
recommends against expressions like "10–50 volts" since it can be mistaken for 
subtraction, and recommends "10 to 50 volts".

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.






[1] Famous last words.


--
Steven
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com