Re: [Python-ideas] SEC: Spectre variant 2: GCC: -mindirect-branch=thunk -mindirect-branch-register

2018-09-16 Thread Wes Turner
Are all current Python builds and C extensions vulnerable to Spectre
variants {1, 2, *}?

There are now multiple threads:

"SEC: Spectre variant 2: GCC: -mindirect-branch=thunk
-mindirect-branch-register"
-
https://mail.python.org/mm3/archives/list/distutils-...@python.org/thread/4BGE226DB5EWIAT5VCJ75QD5ASOVJZCM/
- https://mail.python.org/pipermail/python-ideas/2018-September/053473.html
- https://mail.python.org/pipermail/python-dev/2018-September/155199.html


Original thread (that I forwarded to security@):
"[Python-ideas] Executable space protection: NX bit,"
https://mail.python.org/pipermail/python-ideas/2018-September/053175.html
> ~ Do trampolines / nested functions in C extensions switch off the NX bit?

On Sunday, September 16, 2018, Nathaniel Smith  wrote:

> On Wed, Sep 12, 2018, 12:29 Joni Orponen  wrote:
>
>> On Wed, Sep 12, 2018 at 8:48 PM Wes Turner  wrote:
>>
>>> Should C extensions that compile all add
>>> `-mindirect-branch=thunk -mindirect-branch-register` [1] to mitigate the
>>> risk of Spectre variant 2 (which does indeed affect user space applications
>>> as well as kernels)?
>>>
>>
>> Are those available on GCC <= 4.2.0 as per PEP 513?
>>
>
> Pretty sure no manylinux1 compiler is ever going to get these mitigations.
>
> For manylinux2010 on x86-64, we can easily use a much newer compiler: RH
> maintains a recent compiler, currently gcc 7.3, or if that doesn't work for
> some reason then the conda folks have be apparently figured out how to
> build the equivalent from gcc upstream releases.
>

Are there different CFLAGS and/or gcc compatibility flags in conda builds
of Python and C extensions?

Where are those set in conda builds?

What's the best way to set CFLAGS in Python builds and C extensions?

export CFLAGS="-mindirect-branch=thunk -mindirect-branch-register"
./configure
make

?

Why are we supposed to use an old version of GCC that doesn't have the
retpoline patches that only mitigate Spectre variant 2?


>
> Unfortunately, the manylinux2010 infrastructure is not quite ready... I'm
> pretty sure it needs some volunteers to push it to the finish line, though
> unfortunately I haven't had enough time to keep track.
>

"PEP 571 -- The manylinux2010 Platform Tag"
https://www.python.org/dev/peps/pep-0571/

"Tracking issue for manylinux2010 rollout"
https://github.com/pypa/manylinux/issues/179

Are all current Python builds and C extensions vulnerable to Spectre
variants {1, 2, *}?

>
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-16 Thread Antoine Pitrou
On Sun, 16 Sep 2018 13:32:26 -0400
"Franklin? Lee"
 wrote:
> On Sun, Sep 16, 2018 at 4:14 AM Antoine Pitrou  wrote:
> >
> > Yeah, right.
> >
> > You know, when I was pointing out Calvin not being very brave by
> > attacking a bunch of people without giving names, my aim was to merely
> > point out how dishonest and disrespectful his attitude his.  *Not* to
> > encourage someone to turn his post into more of a clusterfuck of
> > personal attacks.  
> 
> Please give an example of an attack I made above. I see accusations,
> made against adults, regarding actions.

Why would I?  As you admit, you are not countering arguments, but
accusing people.  I have better to do than to waste my time in this
kind of game.  This mailing-list is not supposed to be a playground for
angry people.

Regards

Antoine.


___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-16 Thread Franklin? Lee
On Sun, Sep 16, 2018 at 4:14 AM Antoine Pitrou  wrote:
>
> Yeah, right.
>
> You know, when I was pointing out Calvin not being very brave by
> attacking a bunch of people without giving names, my aim was to merely
> point out how dishonest and disrespectful his attitude his.  *Not* to
> encourage someone to turn his post into more of a clusterfuck of
> personal attacks.

Please give an example of an attack I made above. I see accusations,
made against adults, regarding actions.

On Sun, Sep 16, 2018, 05:45 David Mertz  wrote:
>
> You have missed the use of *reductio ad absurdum* in my comment and several 
> others. This argument structure is one of the fundamental forms of good 
> logical reasoning, and shows nothing dismissive or insulting. The specifics 
> book titles I used were carefully chosen, and you'd do well to think about 
> why those specific books (and read all of them, if you haven't).

Reductio ad absurdum and mockery are not mutually exclusive. Mockery
can be thought of as a natural (though often fallacious) form of
reductio ad absurdum: the position (or person) should not be taken
seriously because the consequences are absurd.

The examples I chose were not simply coldly rational arguments, so we
can look at the extra choices made. I'm sure you can see the
difference between these two logically-equivalent arguments:
- "Assume there is a largest prime. Then we can construct a large
number which is not divisible by any prime. But that's impossible, so
there is no largest prime."
- "Since you believe there is a largest prime, we have a large number
not divisible by any prime. I'll start on that pull request to change
INT_MAX to the largest prime."

For granularity, let:
"disrespectful" := Negative respect, such as an insult.
"unrespectful" := Without proper respect, but not as bad as "disrespectful".

Other than mockery, there can be disrespectful argumentum ad absurdum.
Often, the difference between a respectful and an unrespectful
argument is how much logical effort is needed to reach the absurdity,
because that is the effort that wasn't put in, or incorrectly put in.
(Thinking off the top of my head, a slippery slope argument is often
unrespectful.)

While people often make small logical mistakes when new to a subject
or idea, or miss immediate consequences, there are many cases where
the person has clearly thought about their position before, and a
logically-obvious one-line counter is an insult to their effort, if
not their intelligence. If you do think you have an obvious one-line
counter, even after considering whether you misunderstood the original
argument, then putting it as a question is more respectful than
stating it conclusively, which is more respectful than making it
sarcastically.

More generally, a respectful argument aims to convince your opponents,
while an argument made with the audience in mind can be unrespectful,
and an argument which mostly appeals to those that already agree is
usually disrespectful.

In your specific case, you used sarcasm, a one-liner argument (listing
a few titles without elaborating on their relevance), slippery slope,
talked about book-burning when the OP was suggesting a change for
future work, and focused on the word "beautiful" where the OP focused
on "ugly". Was your post crafted to convince the OP, or for the sake
of a laugh? Do you believe that your post could convince any of your
opponents? Would you have said it that way in a room where no one was
already on your side?
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-16 Thread Wes Turner
On Sunday, September 16, 2018, Wes Turner  wrote:

>
> It may be most relevant to interpret the poem as it is: culled from
> various writings of the community.
>
> What do we need to remember? Our criticism can hurt fragile feelings and
> egos; which we need to check at the door.
>

Dear Python community,


>
> https://en.wikipedia.org/wiki/Aesthetics
> https://en.wikipedia.org/wiki/Body_dysmorphic_disorder
> https://en.wikipedia.org/wiki/Compensation (time spent disambiguating)
>
> Python is primarily an online community; where words are our appearance.
>

We should strive to be concise.

"I don't like it because it's ugly" is not a helpful code review.

Subjective assertions of superiority are only so useful in context to the
objectives (e.g. reducing complexity)


>
> "Most reasonable people would understand that" we're *clearly* talking
> about engineering design aesthetic.
>
> Not body dysmorphia.
> Objectively,
>

That's subjective

Compared to C,
>

C has different objectives for a different market.


> Python is fat and slow.
>

Python is plenty fast for people all over the world who are solving
problems for others.


> It's not fast, but it's pretty,
> and that's all it has going for it,
>

Python has lots of things to be proud of and confident about (i.e. helping
others and paying bills).


> In this crazy world.
>
>
> Mean losers,
> T-shirts.
>

Attention seeking AND problem solving


>
> Code of Conduct: http://python.org/psf/codeofconduct/
>
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-16 Thread Wes Turner
On Saturday, September 15, 2018, Franklin? Lee <
leewangzhong+pyt...@gmail.com> wrote:

> I am very disappointed with the responses to this thread. We have
> mockery, dismissiveness, and even insinuations about OP's
> psychological health. Whether or not OP is a troll, and whether or not
> OP's idea has merit, that kind of response is unnecessary and
> unhelpful.
>
> (While I lean toward OP being a troll, the fact that the OP's name is
> the same as a Canadian actress is insignificant. Chinese surnames are
> single-syllable, there are only so many one-syllable surnames, and
> "Samantha" is a common-enough name.)
>
> Since Antoine challenged Calvin to name names, I will name names. If
> the thread devolves into one-on-one fights, then you'll know why
> Calvin didn't do it.
>
> Antoine:
> - Accusing the OP of not being open-minded for proposing (not
> "insisting on"!) the idea at all.
> "You ask others to be open-minded, but fail to show such an
> attitude yourself."
> - Labeling the OP's position as reactionary, and intolerant.
> "And, as a French person, I have to notice this is yet another
> attempt to impose reactionary, intolerant American politics on the
> rest of the world (or of the Python community)."
>
> David Mertz: Sarcastically suggesting that we burn programming books
> if they use "beautiful" in their titles.
>
> Chris Angelico: This implied accusation:
> "Not everyone assumes the worst about words."
>
> Oleg:
> - Dismissing the whole post as a troll.*
> "Nice trolling, go on! :-D"
> - Calling the OP's idea stupid, and calling a different (settled)
> decision stupid. (One can argue Oleg isn't really calling anything
> stupid, but I preemptively say that's a stupid argument.)
> "Removing master/slave is almost as stupid as ugly/beautiful."
> - Dismissing the stance as oversensitive offense-taking.
> "People shouldn't try and take personal offense to things that
> haven't been applied to them personally, or, even worse, complain
> about a term applied to anything/anyone else in a way they perceive to
> be offensive."
> - Mockery: The entire email with this line is spent on mockery:
> 'I also propose to ban the following technical terms that carry
> dark meanings: "abort", "kill" and "execute" (stop the genocide!) ...'
>
> Greg: Another email spent entirely on mockery:
> """If we're going to object to "slave", we should object to
> "robot" as well, since it's derived from a Czech word meaning "forced
> worker"."""
>
> * There is a difference between discussing whether it is a troll post
> and flippantly stating it as fact. The first brings up a relevant
> concern. The second says, "No one can reasonably believe what you
> claim to believe, so I won't treat you as a rational person."
>
> Jacco:
> - This is completely disrespectful and way over the line. Don't try to
> make a psychological evaluation from two emails, especially when it's
> just someone having an idea you don't like.
> """However, if merely the word ugly being on a page can be
> "harmful", what you really need is professional help, not a change to
> Python. Because there's obviously been some things in your past you
> need to work through."""
> - Mockery.
> """If we have to ban "Ugly" for american sensitivities, then
> perhaps we need to ban a number of others for china's sensitivities.
> Where will it end ?"""
>
> There are people making serious arguments against the idea, including
> the people above. But those arguments could have been made without the
> above examples. The above quotes don't treat the OP or the OP's ideas
> as worthy of a serious and mature response.
>
>
> P.S.: I read Poe's Law not as a warning against falling for trolls,
> but as a warning about confirmation bias. If I keep falling for poes
> of group G, it's probably because I'm too far too willing to believe
> negative things about G, and don't care to understand them.


It may be most relevant to interpret the poem as it is: culled from various
writings of the community.

What do we need to remember? Our criticism can hurt fragile feelings and
egos; which we need to check at the door.

https://en.wikipedia.org/wiki/Aesthetics
https://en.wikipedia.org/wiki/Body_dysmorphic_disorder
https://en.wikipedia.org/wiki/Compensation (time spent disambiguating)

Python is primarily an online community; where words are our appearance.

"Most reasonable people would understand that" we're *clearly* talking
about engineering design aesthetic.

Not body dysmorphia.
Objectively,
Compared to C,
Python is fat and slow.
It's not fast, but it's pretty,
and that's all it has going for it,
In this crazy world.


Mean losers,
T-shirts.



Code of Conduct: http://python.org/psf/codeofconduct/
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-ideas] +1 Pre-conditions and post-conditions by Kaufmann

2018-09-16 Thread James Lu
In response to your Sat, 15 Sep 2018 22:14:43:
A good and thoughtful read. I agree with all your points. +1.
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] SEC: Spectre variant 2: GCC: -mindirect-branch=thunk -mindirect-branch-register

2018-09-16 Thread Wes Turner
On Sunday, September 16, 2018, Wes Turner  wrote:

> Should Python builds add `-mindirect-branch=thunk
> -mindirect-branch-register` to CFLAGS?
>
> Where would this be to be added in the build scripts with which
> architectures?
>
> /QSpectre is the MSVC build flag for Spectre Variant 1:
>
> > The /Qspectre option is available in Visual Studio 2017 version 15.7 and
> later.
>
> https://docs.microsoft.com/en-us/cpp/build/reference/qspectre?view=vs-2017
>
> security@ directed me to the issue tracker / lists,
> so I'm forwarding this to python-dev and python-ideas, as well.
>
> # Forwarded message
> From: *Wes Turner* 
> Date: Wednesday, September 12, 2018
> Subject: SEC: Spectre variant 2: GCC: -mindirect-branch=thunk
> -mindirect-branch-register
> To: distutils-sig 
>
>
> Should C extensions that compile all add
> `-mindirect-branch=thunk -mindirect-branch-register` [1] to mitigate the
> risk of Spectre variant 2 (which does indeed affect user space applications
> as well as kernels)?
>
> [1] https://github.com/speed47/spectre-meltdown-checker/issues/
> 119#issuecomment-361432244
> [2] https://en.wikipedia.org/wiki/Spectre_(security_vulnerability)
> [3] https://en.wikipedia.org/wiki/Speculative_Store_Bypass#Specu
> lative_execution_exploit_variants
>
> On Wednesday, September 12, 2018, Wes Turner  wrote:
>>
>>> On Wednesday, September 12, 2018, Joni Orponen 
>>> wrote:
>>>
 On Wed, Sep 12, 2018 at 8:48 PM Wes Turner 
 wrote:

> Should C extensions that compile all add
> `-mindirect-branch=thunk -mindirect-branch-register` [1] to mitigate
> the risk of Spectre variant 2 (which does indeed affect user space
> applications as well as kernels)?
>

 Are those available on GCC <= 4.2.0 as per PEP 513?

>>>
>>> AFAIU, only
>>> GCC 7.3 and 8 have the retpoline (indirect-branch=thunk) support enabled
>>> by the `-mindirect-branch=thunk -mindirect-branch-register` CFLAGS.
>>>
>>
>  On Wednesday, September 12, 2018, Wes Turner 
> wrote:
>
>> "What is a retpoline and how does it work?"
>> https://stackoverflow.com/questions/48089426/what-is-a-retpo
>> line-and-how-does-it-work
>>
>>
There's probably already been an ANN announce about this?

If not, someone with appropriate security posture and syntax could address:

Whether python.org binaries are already rebuilt

Whether OS package binaries are already rebuilt

Whether anaconda binaries are already rebuilt

Whether C extension binaries on pypi are already rebuilt
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-ideas] SEC: Spectre variant 2: GCC: -mindirect-branch=thunk -mindirect-branch-register

2018-09-16 Thread Wes Turner
Should Python builds add `-mindirect-branch=thunk
-mindirect-branch-register` to CFLAGS?

Where would this be to be added in the build scripts with which
architectures?

/QSpectre is the MSVC build flag for Spectre Variant 1:

> The /Qspectre option is available in Visual Studio 2017 version 15.7 and
later.

https://docs.microsoft.com/en-us/cpp/build/reference/qspectre?view=vs-2017

security@ directed me to the issue tracker / lists,
so I'm forwarding this to python-dev and python-ideas, as well.

# Forwarded message
From: *Wes Turner* 
Date: Wednesday, September 12, 2018
Subject: SEC: Spectre variant 2: GCC: -mindirect-branch=thunk
-mindirect-branch-register
To: distutils-sig 


Should C extensions that compile all add
`-mindirect-branch=thunk -mindirect-branch-register` [1] to mitigate the
risk of Spectre variant 2 (which does indeed affect user space applications
as well as kernels)?

[1] https://github.com/speed47/spectre-meltdown-checker/
issues/119#issuecomment-361432244
[2] https://en.wikipedia.org/wiki/Spectre_(security_vulnerability)
[3] https://en.wikipedia.org/wiki/Speculative_Store_Bypass#
Speculative_execution_exploit_variants

On Wednesday, September 12, 2018, Wes Turner  wrote:
>
>> On Wednesday, September 12, 2018, Joni Orponen 
>> wrote:
>>
>>> On Wed, Sep 12, 2018 at 8:48 PM Wes Turner  wrote:
>>>
 Should C extensions that compile all add
 `-mindirect-branch=thunk -mindirect-branch-register` [1] to mitigate
 the risk of Spectre variant 2 (which does indeed affect user space
 applications as well as kernels)?

>>>
>>> Are those available on GCC <= 4.2.0 as per PEP 513?
>>>
>>
>> AFAIU, only
>> GCC 7.3 and 8 have the retpoline (indirect-branch=thunk) support enabled
>> by the `-mindirect-branch=thunk -mindirect-branch-register` CFLAGS.
>>
>
 On Wednesday, September 12, 2018, Wes Turner  wrote:

> "What is a retpoline and how does it work?"
> https://stackoverflow.com/questions/48089426/what-is-a-
> retpoline-and-how-does-it-work
>
>
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-16 Thread Jan Claeys
On Fri, 2018-09-14 at 22:09 +0200, Davide Rizzo wrote:
> At one Python conference in Italy, participants were given an
> elegantly designed and well-crafted t-shirt with a writing in large
> characters that read "Beautiful is better than ugly" in reference to
> the Zen of Python. Back home, a close person who is not a Python
> programmer nor familiar with PEP 20 saw the t-shirt. They were
> horrified by the out-of-context sentence for reasons similar to what
> has been already stated in support of this argument. It prompted them
> of lookism and judgmentality, and found the message to be disturbing
> in its suggestion to compare by some standard of beauty and to
> discriminate. Let me add some context: this person is socially and
> politically active (maybe what someone would call a "SJW"; definitely
> not what anyone would call "politically correct"), and is specially
> sensitive to issues of discrimination and sexism. This was enough,
> though, for me to wonder what kind of message I would be projecting
> by wearing that writing on me. I've been since then discouraged to
> ever wear the t-shirt in any public context.

This illustrates that by taking something out of context, it can
(appear to) get an entirely different meaning.  This can happen on
purpose or (as in this case, I assume) by accident.

It doesn't say anything about the complete text of the “Zen of Python”
(which to any layperson probably looks quite like unintelligible
gibberish).

The lesson to be learned is: “be careful when taking something out of
context”.


-- 
Jan Claeys
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] Retire or reword the namesake of the Language

2018-09-16 Thread Wes Turner
There's already a thing named Cobra.

https://github.com/opencobra/cobrapy


"Python (mythology)"
https://en.wikipedia.org/wiki/Python_(mythology)
 ... Serpent/Dragon guarding the omphalos.

"Ouroboros"
https://en.wikipedia.org/wiki/Ouroboros


Monty Python themed Python language things:

- The Cheese Shop
  https://en.wikipedia.org/wiki/Cheese_Shop_sketch
  https://wiki.python.org/moin/CheeseShop
  https://pypi.org/

- The Knights Who Say Ni --
  https://en.wikipedia.org/wiki/Knights_Who_Say_Ni
  https://github.com/python/the-knights-who-say-ni

- Miss Islington
  https://github.com/python/miss-islington

On Sunday, September 16, 2018, Chris Angelico  wrote:

> On Sun, Sep 16, 2018 at 8:14 PM, Widom PsychoPath 
> wrote:
> > I hereby propose that the Language should be renamed to Cobra, after
> > the brilliant military strategist Cobra Commander , who has been
> > history's most efficient and brilliant strategist.
> >
> > Yours forever,
> > Jack Daniels
>
> Now THAT is the *true* spirit of professionalism. Here we have proof
> that the scientific community cares about the language.
>
> About 80 proof, I think.
>
> ChrisA
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-16 Thread Steve Barnes



On 16/09/2018 10:45, David Mertz wrote:
> You have missed the use of *reductio ad absurdum* in my comment and 
> several others. This argument structure is one of the fundamental forms 
> of good logical reasoning, and shows nothing dismissive or insulting. 
> The specifics book titles I used were carefully chosen, and you'd do 
> well to think about why those specific books (and read all of them, if 
> you haven't).
> 
For the ultimate "reductio as absurdum" it is possible to argue that one 
(1) is elitist and zero (0) is nihilist therefore to avoid offence we 
should scrap the entire binary system and with it digital computers - 
then the whole argument becomes moot until someone implements python on 
an analogue computer. ;-)

-- 
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect 
those of my employer.

---
This email has been checked for viruses by AVG.
https://www.avg.com

___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] Retire or reword the namesake of the Language

2018-09-16 Thread Chris Angelico
On Sun, Sep 16, 2018 at 8:14 PM, Widom PsychoPath  wrote:
> I hereby propose that the Language should be renamed to Cobra, after
> the brilliant military strategist Cobra Commander , who has been
> history's most efficient and brilliant strategist.
>
> Yours forever,
> Jack Daniels

Now THAT is the *true* spirit of professionalism. Here we have proof
that the scientific community cares about the language.

About 80 proof, I think.

ChrisA
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-ideas] Retire or reword the namesake of the Language

2018-09-16 Thread Widom PsychoPath
Guten Tag,

I am Jack and I am grateful to see the efficiency of scientific
computing in Python.

However, What deeply saddens me is that the namesake "Python" has
unfortunately been derived from the title of the uncivilised British
jester troupe "Monty Python". This is something that deeply infuriates
me and is against the morals of my culture. Although humor is an
integral aspect of the life of an Untermensch, I believe that Python,
A language used as an interface to majority of Scientific computing
software should be renamed to something more suitable.

I hereby propose that the Language should be renamed to Cobra, after
the brilliant military strategist Cobra Commander , who has been
history's most efficient and brilliant strategist.

I hope that my message is not mistaken for an attempt to humor. I am
physically unable to experience the same. Please revert back to the
mail with your thoughts and constructive criticism.

Yours forever,
Jack Daniels
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-16 Thread David Mertz
On Sun, Sep 16, 2018, 4:34 AM Stephen J. Turnbull <
turnbull.stephen...@u.tsukuba.ac.jp> wrote:

> I would also disagree with Greg Ewing's take on "robot".  It may have
> meant "slave" in the original Czech, but in English it has strong
> connotations of "automaton" and an inherent lack of autonomy, quite
> different from a human slave's flexibility to perform any command,


Robot doesn't mean "slave" in Czech, but rather "serf." Serfdom was/is a
terrible institution, but nothing best so terrible as the Atlantic slave
trade of the 15th-19th C which is what modern usage tends to indicates.
Moreover, the morpheme "rōb" is commonplace in Slavic languages to mean
"work" in a more general sense.

Wikipedia: Karl Čapek's fictional story postulated the technological
creation of artificial human bodies without souls, and the old theme of the
feudal robota class eloquently fit the imagination of a new class of
manufactured, artificial workers.
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-16 Thread David Mertz
You have missed the use of *reductio ad absurdum* in my comment and several
others. This argument structure is one of the fundamental forms of good
logical reasoning, and shows nothing dismissive or insulting. The specifics
book titles I used were carefully chosen, and you'd do well to think about
why those specific books (and read all of them, if you haven't).

On Sat, Sep 15, 2018, 11:40 PM Franklin? Lee 
wrote:

> I am very disappointed with the responses to this thread. We have
> mockery, dismissiveness, and even insinuations about OP's
> psychological health. Whether or not OP is a troll, and whether or not
> OP's idea has merit, that kind of response is unnecessary and
> unhelpful.
>
> (While I lean toward OP being a troll, the fact that the OP's name is
> the same as a Canadian actress is insignificant. Chinese surnames are
> single-syllable, there are only so many one-syllable surnames, and
> "Samantha" is a common-enough name.)
>
> Since Antoine challenged Calvin to name names, I will name names. If
> the thread devolves into one-on-one fights, then you'll know why
> Calvin didn't do it.
>
> Antoine:
> - Accusing the OP of not being open-minded for proposing (not
> "insisting on"!) the idea at all.
> "You ask others to be open-minded, but fail to show such an
> attitude yourself."
> - Labeling the OP's position as reactionary, and intolerant.
> "And, as a French person, I have to notice this is yet another
> attempt to impose reactionary, intolerant American politics on the
> rest of the world (or of the Python community)."
>
> David Mertz: Sarcastically suggesting that we burn programming books
> if they use "beautiful" in their titles.
>
> Chris Angelico: This implied accusation:
> "Not everyone assumes the worst about words."
>
> Oleg:
> - Dismissing the whole post as a troll.*
> "Nice trolling, go on! :-D"
> - Calling the OP's idea stupid, and calling a different (settled)
> decision stupid. (One can argue Oleg isn't really calling anything
> stupid, but I preemptively say that's a stupid argument.)
> "Removing master/slave is almost as stupid as ugly/beautiful."
> - Dismissing the stance as oversensitive offense-taking.
> "People shouldn't try and take personal offense to things that
> haven't been applied to them personally, or, even worse, complain
> about a term applied to anything/anyone else in a way they perceive to
> be offensive."
> - Mockery: The entire email with this line is spent on mockery:
> 'I also propose to ban the following technical terms that carry
> dark meanings: "abort", "kill" and "execute" (stop the genocide!) ...'
>
> Greg: Another email spent entirely on mockery:
> """If we're going to object to "slave", we should object to
> "robot" as well, since it's derived from a Czech word meaning "forced
> worker"."""
>
> * There is a difference between discussing whether it is a troll post
> and flippantly stating it as fact. The first brings up a relevant
> concern. The second says, "No one can reasonably believe what you
> claim to believe, so I won't treat you as a rational person."
>
> Jacco:
> - This is completely disrespectful and way over the line. Don't try to
> make a psychological evaluation from two emails, especially when it's
> just someone having an idea you don't like.
> """However, if merely the word ugly being on a page can be
> "harmful", what you really need is professional help, not a change to
> Python. Because there's obviously been some things in your past you
> need to work through."""
> - Mockery.
> """If we have to ban "Ugly" for american sensitivities, then
> perhaps we need to ban a number of others for china's sensitivities.
> Where will it end ?"""
>
> There are people making serious arguments against the idea, including
> the people above. But those arguments could have been made without the
> above examples. The above quotes don't treat the OP or the OP's ideas
> as worthy of a serious and mature response.
>
>
> P.S.: I read Poe's Law not as a warning against falling for trolls,
> but as a warning about confirmation bias. If I keep falling for poes
> of group G, it's probably because I'm too far too willing to believe
> negative things about G, and don't care to understand them.
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-ideas] Combine f-strings with i18n

2018-09-16 Thread Stephen J. Turnbull
Hans Polak writes:

 > The second problem is that I need to translate strings on the fly.

I don't understand what that means.  gettext() does exactly that.  Do
you mean you need to switch languages on the fly?

 > I propose to add a f''.language() method to the f-string format.
 >
 > Rationale:
 > 
 > More pythonic.

I don't think so, since as Chris points out, an f-string is an
expression whose value is a str, with the values of the locals already
interpolated in the string.  You'd need a lot of magic in the compiler
to make this work.

 > At this moment, _('').format() is the way to go, so I 
 > would need to wrap another call around that: T(_(''), args, 'es_ES') 
 > <===This is an ugly hack.
 > 
 > # Set the _() function to return the same string
 > 
 > _ = lambda s: s
 > 
 > es = gettext.translation('myapplication', languages=['es_ES'])

If, as I guessed, you want to change languages on the fly, I would
advise to make a hash table of languages used so far, and add
translation tables to it on the fly as new languages are requested.
Or, if space is at a premium, a LRU cache of tables.

 > def T(translatable_string, args_dictionary = None, language = None)
 > 
 >      if 'es_ES' == language:
 > 
 >          # Return translated, formatted string
 > 
 >          return es.gettext(translatable_string).format(args)
 > 
 > 
 >      # Default, return formatted string
 > 
 >      return translatable_string.format(args)

Then you can replace this with

# Use duck-typing of gettext.translation objects
class NullTranslation:
def __init__(self):
self.gettext = lambda s: s

def get_gettext(language, translation={'C': NullTranslation()}):
if language not in translation:
translation[language] = \
gettext.translation('myapplication', languages=[language])
return translation[language].gettext

and

# This could be one line, but I guess in many cases you're likely
# to use use the gettext function repeatedly.  Also, use of the
# _() idiom marks translatable string for translators.
_ = get_gettext(language)
_(translatable_string).format(key=value...)

instead of T(translatable_string, args, language) which isn't great
style (the names "T" and "args" are not very evocative).  It's a
little more code, but it doesn't require changing the semantics of
existing Python code, and is prettier than your T() function IMO.

Steve

___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-16 Thread Stephen J. Turnbull
Chris Barker via Python-ideas writes:

 > We now have anecdotal evidence that "beautiful is better than ugly"
 > can be offensive out of context. Other than that, we have people
 > "suspecting" or "imagining" that some people "may" find it
 > offensive in context.

"Sam" at yandex.ru did not even do that.  She just took it out of
context.  The post was a troll, whether she is or not.

So put it back in context.  PyCon 2017 had the whole python -m this on
the back of the shirts.  If somebody *ever* complains about that, I'll
bite my tongue and ignore them.

 > Is it any better to make a change that has not been asked for by
 > imagining other's sensitivities than it is to ignore others'
 > sensitivities?

Either way you're ignoring their actual sensitivities, so it's at root
the same (the former manifests as patronizing, the latter as rude).

On the other hand, sometimes there are better terms to use.  It's one
thing to pull "beautiful is better than ugly" out of a poem in which
most of the lines follow that same pattern of " is
better than ", breaking the symmetry.

It's another when replacing "master/slave" comes up, and it's pointed
out that there *are* more precise terms, such as "original/replica",
in some contexts.  I'm of two minds as whether it's worth the churn,
but if others are willing to do the work ;-) of finding all the uses,
proposing replacements, and submitting the PRs, I'd be willing to
review and add my $.02 as to whether there's actually an improvement.

I would also disagree with Greg Ewing's take on "robot".  It may have
meant "slave" in the original Czech, but in English it has strong
connotations of "automaton" and an inherent lack of autonomy, quite
different from a human slave's flexibility to perform any command, and
the way a human slave's autonomy is stripped by force, respectively.
If Czech-speakers want to offer their opinions, I'm listening, but I
wouldn't be surprised to find that their consensus opinion in 2018 to
be that the English usage of robot is more prevalent than the Czech
original meaning.

Steve
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-16 Thread Antoine Pitrou


Yeah, right.

You know, when I was pointing out Calvin not being very brave by
attacking a bunch of people without giving names, my aim was to merely
point out how dishonest and disrespectful his attitude his.  *Not* to
encourage someone to turn his post into more of a clusterfuck of
personal attacks.

Regards

Antoine.


On Sat, 15 Sep 2018 23:39:22 -0400
"Franklin? Lee"
 wrote:

> I am very disappointed with the responses to this thread. We have
> mockery, dismissiveness, and even insinuations about OP's
> psychological health. Whether or not OP is a troll, and whether or not
> OP's idea has merit, that kind of response is unnecessary and
> unhelpful.
> 
> (While I lean toward OP being a troll, the fact that the OP's name is
> the same as a Canadian actress is insignificant. Chinese surnames are
> single-syllable, there are only so many one-syllable surnames, and
> "Samantha" is a common-enough name.)
> 
> Since Antoine challenged Calvin to name names, I will name names. If
> the thread devolves into one-on-one fights, then you'll know why
> Calvin didn't do it.
> 
> Antoine:
> - Accusing the OP of not being open-minded for proposing (not
> "insisting on"!) the idea at all.
> "You ask others to be open-minded, but fail to show such an
> attitude yourself."
> - Labeling the OP's position as reactionary, and intolerant.
> "And, as a French person, I have to notice this is yet another
> attempt to impose reactionary, intolerant American politics on the
> rest of the world (or of the Python community)."
> 
> David Mertz: Sarcastically suggesting that we burn programming books
> if they use "beautiful" in their titles.
> 
> Chris Angelico: This implied accusation:
> "Not everyone assumes the worst about words."
> 
> Oleg:
> - Dismissing the whole post as a troll.*
> "Nice trolling, go on! :-D"
> - Calling the OP's idea stupid, and calling a different (settled)
> decision stupid. (One can argue Oleg isn't really calling anything
> stupid, but I preemptively say that's a stupid argument.)
> "Removing master/slave is almost as stupid as ugly/beautiful."
> - Dismissing the stance as oversensitive offense-taking.
> "People shouldn't try and take personal offense to things that
> haven't been applied to them personally, or, even worse, complain
> about a term applied to anything/anyone else in a way they perceive to
> be offensive."
> - Mockery: The entire email with this line is spent on mockery:
> 'I also propose to ban the following technical terms that carry
> dark meanings: "abort", "kill" and "execute" (stop the genocide!) ...'
> 
> Greg: Another email spent entirely on mockery:
> """If we're going to object to "slave", we should object to
> "robot" as well, since it's derived from a Czech word meaning "forced
> worker"."""
> 
> * There is a difference between discussing whether it is a troll post
> and flippantly stating it as fact. The first brings up a relevant
> concern. The second says, "No one can reasonably believe what you
> claim to believe, so I won't treat you as a rational person."
> 
> Jacco:
> - This is completely disrespectful and way over the line. Don't try to
> make a psychological evaluation from two emails, especially when it's
> just someone having an idea you don't like.
> """However, if merely the word ugly being on a page can be
> "harmful", what you really need is professional help, not a change to
> Python. Because there's obviously been some things in your past you
> need to work through."""
> - Mockery.
> """If we have to ban "Ugly" for american sensitivities, then
> perhaps we need to ban a number of others for china's sensitivities.
> Where will it end ?"""
> 
> There are people making serious arguments against the idea, including
> the people above. But those arguments could have been made without the
> above examples. The above quotes don't treat the OP or the OP's ideas
> as worthy of a serious and mature response.
> 
> 
> P.S.: I read Poe's Law not as a warning against falling for trolls,
> but as a warning about confirmation bias. If I keep falling for poes
> of group G, it's probably because I'm too far too willing to believe
> negative things about G, and don't care to understand them.
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
> 



___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/