Re: Ideas about how software should behave

2017-11-09 Thread Rurpy via Python-list
On 11/08/2017 08:18 PM, Ben Finney wrote:
> Ned Batchelder  writes:
> [...]
>> Second, now you want us to agree that calling someone arrogant isn't
>> an attack?
> 
> It's one thing to say “this idea is arrogant”, which is what Steve did.
> That's not in any way personal, nor an attack on a person. It criticises
> an idea.
> 
> If instead Steve said “that was an arrogant action”, the person is being
> criticised. But it's still not *characterising* the person; it
> characterises the action. It says nothing about whether the person is
> arrogant.
> 
> If instead of either of those Steve said “you are arrogant”, that would
> warrant the response, in my estimation.
> 
> That it got nowhere near that is why I'm pleading that we stop treating
> criticism of ideas as though it were an attack on a person.

People and their ideas are not separable.  The ideas that
people have and promote are part of what makes them who
they are.  You cannot criticize their ideas without criticizing 
them.  That you make up some pet theory about how people 
*should* be does not change the reality of how people *are*.

And when you apply anthropocentric terms to "an idea" (which 
obviously does not have "behavior" of it's own, the attempts 
of you and Chris to make that claim not withstanding) you 
reinforce the sense that you are talking about the person.
If I said, "that's an idea that an asshole would think up",
there is no one (other than perhaps you and Chris) who wouldn't
recognize that I was calling you an asshole. 

Conversely, while you claim any incivility is allowable 
when criticizing an idea you claim there's a requirement 
to respect a person.  Do you respect the terrorist who 
killed the hostages in Sydney a couple years ago? Or any 
number of other lowlifes?  Or maybe you'll now waffle about 
and limit respect to speech?  Suppose I came here and start
spouting neo-Nazi racist rants.  Do you seriously claim
people should criticize my ideas but not me?  That's so far 
from recognized human behavior that it justifies being called 
a crackpot theory.

If you want to show respect to people whose ideas you disagree 
with or even disrespect you do so by leaving out the insults, 
the innuendos, the aggressive language, completely subjective 
and unprovable non-facts like "arrogant" and "stupid", and just 
make a rational case why the other person is wrong in your 
opinion.  That also shows respect to other readers most of 
whom I bet dont want to read the constant verbal dueling that 
occurs so regularly here.

Nobody is saying not to criticize: it is how it is done that
is the problem.

But of course that is nowhere near as much fun, is it?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Ideas about how software should behave

2017-11-09 Thread Rurpy via Python-list
On 11/08/2017 11:29 AM, Chris Angelico wrote:
> [...]
> Please, Jon, accept that we were not deliberately trying
> to put you down. Steve, if you can clearly state your position on this
> (possibly worded in the form of an apology?), it would go a long way
> to clearing this up.
> ChrisA

Are you the same ChrisA who wrote in this very list just a month ago
towards a poster you disagreed with:

 "Yep. Good reasons like that you're a moron." [*]

Maybe you could set an example for Steve?  It would go a long way 
to showing that you, Steven, Ben an a few others aren't setting a duel
standard where favored regular "alpha male" posters can be as rude as
they want but the Code of Conduct is dragged out to whack non-alphas 
when they respond the same way.

[*] https://mail.python.org/pipermail/python-list/2017-October/727190.html
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Ideas about how software should behave

2017-11-09 Thread Rurpy via Python-list
On 11/09/2017 09:33 AM, Chris Angelico wrote:
> On Fri, Nov 10, 2017 at 2:14 AM, Rurpy via Python-list 
>  wrote:
>> On 11/08/2017 11:29 AM, Chris Angelico wrote:
>>> [...]
>>> Please, Jon, accept that we were not deliberately trying
>>> to put you down. Steve, if you can clearly state your position on this
>>> (possibly worded in the form of an apology?), it would go a long way
>>> to clearing this up.
>>> ChrisA
>>
>> Are you the same ChrisA who wrote in this very list just a month ago
>> towards a poster you disagreed with:
>>
>>  "Yep. Good reasons like that you're a moron." [*]
> 
> If I said that, there's more to it than just that I disagreed with the person.

"If"?  You are not sure?  I included a link to your message
in my post which you seem to have cut.  Here it is again:
   https://mail.python.org/pipermail/python-list/2017-October/727190.html
If it is a forgery, maybe the moderators can remove it.  But 
unless you want to categorically deny you wrote it, I think we 
can assume that you did.

I stand by what I've claimed on several occasions: that offensive 
(and CoC violating) posts such as your's and Steven's are regularly 
posted by a handful of regulars here, and not only are there  
typically no objections but other members of the cabal actually 
jump in to defend the bad behavior.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Ideas about how software should behave

2017-11-09 Thread Rurpy via Python-list
On 11/09/2017 10:51 AM, Rhodri James wrote:
> On 09/11/17 17:41, Michael Torrie wrote:
>> On 11/09/2017 09:33 AM, Chris Angelico wrote:
>>> On Fri, Nov 10, 2017 at 2:14 AM, Rurpy via Python-list 
>>>  wrote:
>>>> On 11/08/2017 11:29 AM, Chris Angelico wrote:
>>>>> [...] Please, Jon, accept that we were not deliberately
>>>>> trying to put you down. Steve, if you can clearly state your
>>>>> position on this (possibly worded in the form of an
>>>>> apology?), it would go a long way to clearing this up. 
>>>>> ChrisA
>>>> 
>>>> Are you the same ChrisA who wrote in this very list just a
>>>> month ago towards a poster you disagreed with:
>>>> 
>>>> "Yep. Good reasons like that you're a moron." [*]
>>> 
>>> If I said that, there's more to it than just that I disagreed
>>> with the person.
>> 
>> But how does that justify the comment? Sounds like a
>> rationalization to me. A little humility on all our parts goes a
>> long ways.  One can apologize for offense taken, even if none was
>> intended, and even if my own opinion is still strongly held.
> 
> But some people really do behave moronically on this list.  I
> generally killfile them before the urge to insult gets too strong,
> but I do see Chris's point; leaving people with the idea that
> unacceptable behaviour is acceptable is a service to no one.

"unacceptable behavior" being having an opinion different than 
Chris'?  And a response of "you're a moron" is quite acceptable 
in your opinion?  You are obviously not alone in feeling that way 
but if that is the defacto policy here then the CoC should be 
changed to reflect that.  
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Cannot pass a variable given from url to route's callback fucntion and redirect issue

2018-08-30 Thread Rurpy via Python-list
On Wednesday, August 29, 2018 at 10:57:35 AM UTC-6, Νίκος Βέργος wrote:
> Flask app.py
> ==
> @app.route( '/' )
> @app.route( '/' )
> def index( page ):
> 
> # use the variable form template for displaying
> counter = '''
>   
>   td> Αριθμός Επισκεπτών: 
>  %d 
> 
>   
>   ''' % (page, pagehit)
> 
> if page != 'index.html':
> pdata = redirect( 'http://superhost.gr/cgi-bin/' + page )
> return pdata
> 
> 
> Template ndex.html
> ==
> 
>  src="/static/images/π.gif"> 
> 
> 
>   src="/static/images/download.gif">
> 
> 
> 1. All i want ro do is when the user clicks on the images within the html 
> tamplate, to pass those variables value to '/' route so to perfrom then asome 
> action with those values
> 
> The error iam receiving is this:
> ===
> builtins.TypeError
> TypeError: index() missing 1 required positional argument: 'page'
> 
> I mean i do have  declared in route and also do  have 'page' as 
> variable to the callback fucntion, why cant it see it?
> 
> 2. Also about the redirect funtion iam using... is there a way to get back 
> the HTML response of running that cgi-scrit and then add another HTML value 
> to that response? I used subprocess and Response but they weren able to 
> deliver the content back the pdata variable for display.
> What i actually want to do among other things is from within my flask app 
> script to try to run and get theresponse back of a cgi-script


I haven't looked at your problem in detail (I seldom read this group
anymore) but I think you want something like:

  def index( page='myhomepage' ):

If the function gets called via the "/" url, there will be no 'page'
argument so you need to write the function signature to make that 
argument optional.

No idea about question #2.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Cannot pass a variable given from url to route's callback fucntion and redirect issue

2018-08-30 Thread Rurpy via Python-list
On Thursday, August 30, 2018 at 10:08:34 AM UTC-6, Νίκος Βέργος wrote:
> I did try it with 'None' and as page='index.html' Flask return an error both 
> ways (while bottle framework does not)

I think you are mistaken, making the change I suggested
fixes the "TypeError: index() missing 1 required positional 
argument" error you asked about.

Appended below is a runnable version of your code.  I couldn't
tell from your post whether you just left out code after the 
"if page !=..." statement for posting or whether is is acually
missing in your code.  I filled what was need to run.  Neither 
the html in your code or the temple are referenced by the code
you posted so you'll need put the pieces together.

> 2. Also about the redirect funtion iam using... is there a way to get back 
> the HTML response of running that cgi-scrit and then add another HTML value 
> to that response? I used subprocess and Response but they weren able to 
> deliver the content back the pdata variable for display.
> What i actually want to do among other things is from within my flask app 
> script to try to run and get theresponse back of a cgi-script

A subprocess should work if you run it with environment variables 
set up the way web server would call it with.  Alternatively
you could take the code in the cgi script (assuming its python)
and put it in a module function somewhere, then the cgi script
becomes a wrapper around a function call to it, and you can call 
the same function in your flask code.

One last point: redirecting to an arbitrary page based on a url 
provided by an untrusted user strikes me as dangerous.  I would 
at least whitelist the pages with something like:
   if page not in ('products', 'about', help'): abort (404)

Hope this helps...
--

from flask import Flask, redirect
app = Flask (__name__)

@app.route( '/' )
@app.route( '/' )
def index( page='index.html' ):
# use the variable form template for displaying
pagehit = 333  # Tempory for testing
counter = '''

td> Αριθμός Επισκεπτών: 

 %d 

''' % (page, pagehit)
if page != 'index.html':
pdata = redirect( 'http://xxsuperhost.gr/cgi-bin/' + page )
else: pdata = "Hi, I'm the index page"
return pdata

@app.route('/log')
def log(): return "Hi, I'm the /log page"

if __name__ == '__main__': 
app.run (host='0.0.0.0', debug=True)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to exit from a nested loop in python

2019-02-08 Thread Rurpy via Python-list
On Thursday, February 7, 2019 at 11:45:23 PM UTC-7, Kaka wrote:
> for i  in range(len(A.hp)):
> 
> for j in range(len(run_parameters.bits_Mod)):
>  req_slots[j] = math.ceil((A.T[i])
> 
>  for g in Temp[i]["Available_ranges"][j]:
>   for s in range(g[0], g[-1]):
>   if (s+req_slots[j]-1) <= g[-1]:
>  if (Temp[i]['cost'][j] <= (run_parameters.PSD):  -- When 
> this condition is true i want to break the nested loop and start from the 
> begining
>served_count +=1
>A.T[i]["First_index"]= s
>A.T[i]["Last_index"]= s+req_slots[j]-1
>A.T[i]["Status"]= 1
>A.T[i]["Selected_MOD"] = j
>break
> 
> I have this code. When the last "if" condition is satisfied, i want to break 
> all the loops and start the nested loop for next i. else, the loop should 
> continue.  
> 
> can anyone help me?

In addition to the two methods Peter posted there is also
the obvious way of using a flag (but perhaps this is what 
you were trying to avoid?)

  for i in (1,2,3):
  nexti = False
  for g in (1,2,3):
  for s in (1,2,3):
  print (i,g,s)
  if (g,s) == (2,2):
  nexti = True
  break
  if nexti: break

You can also use exceptions to do a multi-level break:

  class Next_i (Exception): pass
  for i in (1,2,3):
  try:
  for g in (1,2,3):
  for s in (1,2,3):
  print (i,g,s)
  if (g,s) == (2,2):
  raise Next_i
  except Next_i: continue

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Encapsulation in Python

2016-03-14 Thread rurpy--- via Python-list
On 03/14/2016 05:19 PM, Mark Lawrence wrote:
> On 14/03/2016 22:40, BartC wrote:
> > [...a polite and reasonable comment...]
>
> Drivel.  Any establised member of this community, or any other
> community for that matter, will always publish, unless, like the RUE,
> they've got something to hide.  So you're just a chicken.  Where do
> you buy the paint from for the streaks down your back?  Just in case
> you can't guess it is yellow.  I'll state the colour just in case
> your knowledge of colours is the same as your so called knowledge of
> computing, something of which I'm far from persuaded, on the grounds
> that speed simply is not the sole criteria for a language.

How much longer is the community going to ignore this nastiness?
These repeated vitriolic personal attacks are creating a poisonous
and hostile atmosphere that I and I'm sure many others don't want
to be exposed to when reading this group.

If I recall correctly, Mr. Lawrence was ejected from the developers
list a few years ago for the same kind of offensive behavior.

I suggest that both Mr. Lawrence and the list monitors review

  https://www.python.org/psf/codeofconduct/

and ask themselves if that document has any meaning at all.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: "no module named kivy" import error in ubuntu 14.04

2015-08-16 Thread rurpy--- via Python-list
On Sunday, August 16, 2015 at 8:00:14 PM UTC-6, Chris Angelico wrote:
> On Mon, Aug 17, 2015 at 5:16 AM, shiva upreti  
> wrote:
> > I am new to linux. I tried various things in attempt to install kivy. I 
> > installed python 2.7.10 (I think python3 was already installed in ubuntu 
> > 14.04). Then i downloaded kivy from 
> > https://pypi.python.org/packages/source/K/Kivy/Kivy-1.9.0.tar.gz, extracted 
> > it and tried to execute "python setup.py" inside the kivy folder.
> 
>[...] 
> use pip (maybe inside a virtualenv). It'll chug for a while and
> then give you what you need.

Umm, actually no...

| ~# pip3 install kivy
| Downloading/unpacking kivy
|   Downloading Kivy-1.9.0.tar.gz (16.2MB): 16.2MB downloaded
|   Running setup.py (path:/tmp/pip-build-m40337r5/kivy/setup.py) egg_info for 
package kivy
| Traceback (most recent call last):
|   File "", line 17, in 
|   File "/tmp/pip-build-m40337r5/kivy/setup.py", line 173, in 
| from Cython.Distutils import build_ext
|ImportError: No module named 'Cython'
| Cython is missing, its required for compiling kivy !

(on Fedora-21 where no kivy repo package is available)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: "no module named kivy" import error in ubuntu 14.04

2015-08-16 Thread rurpy--- via Python-list
On Sunday, August 16, 2015 at 10:14:29 PM UTC-6, Laura Creighton wrote:
> In a message of Sun, 16 Aug 2015 20:19:49 -0700, rurpy--- via Python-list 
> writes:
> >On Sunday, August 16, 2015 at 8:00:14 PM UTC-6, Chris Angelico wrote:
> >>[...] 
> >> use pip (maybe inside a virtualenv). It'll chug for a while and
> >> then give you what you need.
> >
> >Umm, actually no...
> >
> >| ~# pip3 install kivy
> >| Downloading/unpacking kivy
> >|   Downloading Kivy-1.9.0.tar.gz (16.2MB): 16.2MB downloaded
> >|   Running setup.py (path:/tmp/pip-build-m40337r5/kivy/setup.py) egg_info 
> >for package kivy
> >| Traceback (most recent call last):
> >|   File "", line 17, in 
> >|   File "/tmp/pip-build-m40337r5/kivy/setup.py", line 173, in 
> >| from Cython.Distutils import build_ext
> >|ImportError: No module named 'Cython'
> >| Cython is missing, its required for compiling kivy !
> >
> >(on Fedora-21 where no kivy repo package is available)
> >-- 
> >https://mail.python.org/mailman/listinfo/python-list
> 
> If you scroll down
> http://kivy.org/docs/installation/installation-linux.html
> 
> there are instructions for Fedora as well.

Thanks.  But I note that those are all for very old, EoL'd versions
of Fedora.

I manually installed cython with pip, but then the kivy install
failed with some C errors.  At the top of it's multi-thousand line
log output was a warning that it requires cython-0.21.2.  Pip had 
installed cython-0.23.  I installed cython-0.21.2 (since I do not 
use cython for anything else and noting that pip did not bother 
to inform me it was overwriting an existing install) and then pip 
installed kivy without error.  However there were a number of 
warning message about missing somethings (libs or python packages, 
was not clear to me).

So I eventually found the kivy docs on their website where they
list prerequisite packages for installing kivy on ubuntu.  I'll 
translate those to hopefully the equivalent fedora package names, 
install them, reinstall kivy, and get a working kivy install.

The point here that all the above is a LONG way from what was
was posted here: "just type 'pip install kivy' and pip will take 
care of everything".

I hope someday Python gets a decent packaging/distribution story.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: "no module named kivy" import error in ubuntu 14.04

2015-08-17 Thread rurpy--- via Python-list
On 08/17/2015 01:52 AM, Laura Creighton wrote:
> In a message of Sun, 16 Aug 2015 22:05:29 -0700, rurpy--- via Python-list 
> writes:
>> So I eventually found the kivy docs on their website where they
>> list prerequisite packages for installing kivy on ubuntu.  I'll 
>> translate those to hopefully the equivalent fedora package names, 
>> install them, reinstall kivy, and get a working kivy install.

Actually, right after I posted, I saw a Fedora-specific list of
packages on the kivy website. However, after I installed them
and reinstalled kivy I still got the same set of missing package
warning that I got before.
And hoping that the packages just enabled optional features I
tried running the simple "hello-world" program from their website.
It died horribly:

| [CRITICAL] [Window ] Unable to find any valuable Window provider at all!
| egl_rpi - ImportError: cannot import name 'bcm'
| File "/usr/lib64/python3.4/site-packages/kivy/core/__init__.py", line 57, in 
core_select_lib
and
| x11 - ImportError: No module named 'kivy.core.window.window_x11'
| File "/usr/lib64/python3.4/site-packages/kivy/core/__init__.py", line 57, in 
core_select_lib
| fromlist=[modulename], level=0)
| [CRITICAL] [App ] Unable to get a Window, abort.

>> The point here that all the above is a LONG way from what was
>> was posted here: "just type 'pip install kivy' and pip will take 
>> care of everything".
>>
>> I hope someday Python gets a decent packaging/distribution story.
> 
> Can you post what one should do with modern Fedora distributions, so
> we can tell the kivy-devs and they can update that webpage?

Unfortunately I have no idea what one should do. The standard response
in this group is that pip knows, hence I don't need to. I just wanted
to point out the fallacy of that.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python handles globals badly.

2015-09-10 Thread rurpy--- via Python-list
On Thursday, September 10, 2015 at 6:18:39 AM UTC-6, Steven D'Aprano wrote:
> On Thu, 10 Sep 2015 05:18 am, Chris Angelico wrote:
> > On Thu, Sep 10, 2015 at 5:14 AM, Laura Creighton  wrote:
> >> In a message of Thu, 10 Sep 2015 05:00:22 +1000, Chris Angelico writes:
> >>>To get started, you need some other sort of kick.
> >>
> >> Having Brian Kernighan write a really nice book about you, helps a lot.
> > 
> > It kinda does. And of course, it also helps to have a time machine, so
> > you can launch your language when there are less languages around.
> > Today, you compete for attention with myriad languages that simply
> > didn't exist when C was introduced to an unsuspecting world.
> 
> I don't think that's quite right. I think, if anything, there were more
> languages in the 1970s than now, it's just that they tended to be
> proprietary, maybe only running on a single vendor's machine. But even if
> I'm mistaken, I think that there is near-universal agreement that the
> single biggest factor in C's popularity and growth during the 1970s and 80s
> is that it was tied so intimately to Unix, and Unix was taking over from
> mainframes, VAX, etc.

The growth of C and Unix were mutually interdependent, one was not 
the cause of the other.

A big factor in the growth of Unix was that it was portable to 
new hardware relatively easily, a portability made possible by C.

I note that even today, 3 or 4 decades later, the availability of 
Python on a wide variety of platforms is made possible by C.

I also doubt there were more programming languages around in the
1970s than now, on the grounds that there were far fewer people
capable of writing a compiler or interpreter in those days, and 
there were far fewer tools to help, or easily accessible knowledge 
about how to do do it.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Terminology: "reference" versus "pointer"

2015-09-12 Thread rurpy--- via Python-list
Picking a post to respond to, more or less at random...

On Saturday, September 12, 2015 at 9:14:00 AM UTC-6, Rustom Mody wrote:
> On Saturday, September 12, 2015 at 8:11:49 PM UTC+5:30, Laura Creighton wrote:
> > In a message of Sat, 12 Sep 2015 05:46:35 -0700, Rustom Mody writes:
> > >How about lay-English ontology in which "point to" and "refer to" are 
> > >fairly
> > >synonymous?
> > 
> > This I have found is important in teaching, which is why I favour 'bind'
> > and 'binding' -- rather than pointer, pointer, refer to, referring.
> 
> Well we can play humpty dumpty and make any word mean whatever we like.
> However if you are a teacher you will recognize a need for pictures.
> And (as far as I can tell) "Random832" finds a need for the box-n-arrow
> diagrams of classic data-structure books

*The* python data model is a concept that, like all concepts, exist in
human brains. It (and its related terminology) are descriptions agreed
upon by a majority of Python developers, documentors and others.  Its 
purpose is to explain in a simpler way the behavior of a running Python 
program. [*]

It is only one of many possible descriptions. Its value is measured in
how well and efficiently it allows Python programmers to predict the 
behavior of a Python program. I never found its presentation in the
Python documentation very understandable or helpful.

Having programmed in C in the past, the model of Python I eventually 
developed is very much (I think, haven't read the whole thread) like 
Random832's.  I think of boxes (objects) with slots containing "pointers"
that "point" to other boxes.  Even today when dealing with complex 
Python data structures, I draw boxes and arrows to help me understand
them and think of the arrows as "pointers".

Frankly, I feel a little insulted by people who presume that having 
learned what a pointer is in C, that my brain is so rigid that I must 
necessarily think that pointer means exactly what pointer means in C
forever after.  FYI (the general you), I am capable of extracting the 
general principle and applying it to Python.  Not just capable, but 
using the concept from C made understanding Python faster than pretending
that somehow Python has some magical and unique way of structuring data
that's brand new.

Maybe pedagogical research will show that one particular model is more
easily understood by python learners that some other model. But please
keep in mind that learners come in many varieties and that one size will
not fit all. Knowing what a pointer is in C and applying the concept to
model python worked well for me and I would have no hesitation offering 
it as an explanation to others as an option to help someone else's 
understanding if they, like me, find the official model less then 
helpful.


[*] There is also possibly a "data model" used in specifying the 
Python language for implementors but this thread seems to be about
how to describe Python's behavior to users. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Terminology: "reference" versus "pointer"

2015-09-12 Thread rurpy--- via Python-list
On 09/12/2015 10:32 AM, Steven D'Aprano wrote:
> On Sat, 12 Sep 2015 02:42 pm, Random832 wrote:
>[...]
> Computer science and IT is *dominated* by a single usage for "pointer" --
> it's an abstract memory address. The fundamental characteristics of
> pointers are:

Just upthread, you claimed something was "universally agreed"
that was not so at all; so please forgive me for not taking your
*dominated*/single assertion on simply your claim that it is so.
 
> - they are first-class values; you can assign a pointer to a variable;

Not true for Python "pointers"

> - you can dereference a pointer: get the value pointed to;

True for Python "pointers"

> - (in some languages) you can get a pointer to a specific variable (possibly
> an unnamed, dynamic variable allocated in the heap rather than a named,
> statically allocated variable).

True for Python "pointers".

> The last two imply that the language must be one where values have fixed
> addresses, not just as a matter of implementation, but as a matter of
> language semantics. If they are free to move, they cannot have a fixed
> address.

The *address* must be fixed, that is, when you dereference the address
you must always get the same thing back. But that implies nothing about
how or where the thing is stored, or whether it can move or not.

Indeed C and other languages with what even you call pointers get the same
thing back even though the thing actually *has* moved in physical memory,
because the address is denoted as a virtual memory address. I take the
generalized meaning of "address" to be simply a token that allows you
to get back the same thing each time you use it.

> Python, Java, Ruby, Lua, Javascript etc. have *no such concept* as pointer.
> There are no values in these languages which correspond to the standard
> definition of pointer:

They have not such concept because the developers and documentors choose
not to describe that language that way. That does not mean one could not
come up with a perfectly valid description that did include the concept
of pointers.

> - you cannot get a pointer to an object or a variable (a name);
> 
> - since there are no pointers, you cannot dereference them;
> 
> - or assign them to a variable.
> 
> 
> Since pointers can be considered an indirect reference to a value, what sort
> of indirect references does Python have? The simplest thing in Python that
> is somewhat analogous to a pointer is a *name*, since names allow you to
> indirectly refer to some value:
> 
> x = 23
> print(x)  # prints the value referred to by x, not "x" itself.
> ptr = "x"  # equivalent to "the address of x"
> y = globals()[ptr]  # equivalent to dereferencing

Here is another kind of indirect reference

a[0] = 23

The "pointer" in the first item of the list "a" does not have a
name. But we can still dereference it.  The dereferencing happens
automatically when "a[0]" is executed.

> Note that names are not first-class values in Python: there is no Name type,
> and you cannot bind a name to a variable, you have to use a string.
> 
> It's not a very close analogy, but it's the closest Python has.

I think it is a close analogy. Things refer to other things and can
be used to access those other things act like pointers. You are correct
that they are not first class items: one cannot do with them everything
one can do with other items, all one can actually do with them is create
them and dereference them. That of course is a good thing. But that
they are not first class objects does not mean that one can't or shouldn't
use the term "pointer" to describe them. That is, I don't see first-
classness as being a requirement for pointerness. The defining
characteristic of a pointer is that it, well, points to something.

It may not be appropriate way to describe Python for everybody but
it is perfectly reasonable (and even preferable) for people with
an understanding of "pointers" from some other language. And for
those people who don't then one could argue they are a clean slate
and using the word "pointer" won't hurt.

(JFTR, I am not against describing python in terms of "reference",
"binding" etc, I just object to the vehement frothing at the mouth
and insistence of one Single Truth that occurs here whenever anyone
attempts to present some alternative. As I said in another post one
size does not fit all.)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Terminology: "reference" versus "pointer"

2015-09-12 Thread rurpy--- via Python-list
On 09/12/2015 11:48 AM, Steven D'Aprano wrote:
> On Sun, 13 Sep 2015 02:17 am, ru...@yahoo.com wrote:
> [...]
>> the model of Python I eventually 
>> developed is very much (I think, haven't read the whole thread) like
>> Random832's.  I think of boxes (objects) with slots containing "pointers"
>> that "point" to other boxes.  Even today when dealing with complex
>> Python data structures, I draw boxes and arrows to help me understand
>> them and think of the arrows as "pointers".
> 
> If you're going to abuse terminology, why don't you call the boxes "floats"
> since they "float around in memory",
> [...]

I was not proposing that, I was talking about the use of the term
"pointer".

> C is not the only, or even the first, language to have standardised on a
> meaning for pointer in computer science. Pascal had pointers long before C,
> and I'm sure Pascal wasn't the first either.

[I'm not sure about the "long before" part given they were nearly
contemporaneous.]

Right, and each of them uses the word (and others like "function", "call"
"arguments", etc) in their own specific way, which they define as part
of the description of the language. "function" in C is different than
"function" in Pascal which is different than "function" in Python.

That C (or Pascal) used the term first does not mean that it was
"standardized" by that use to have that precise definition forever after.

> "Pointer" is a standard primitive data type across dozens of languages: it's
> an abstract data type holding the memory address of a variable (either a
> named, statically allocated variable, or more often, an anonymous,
> dynamically allocated variable). As such, it requires that variables have a
> fixed address. If the variable can move, the pointer will no longer point
> to the variable.

See my comments on "fixed address" in another post.  Your definition of
"address" is too narrow.

> If you want to use "pointer" to refer to something else, the onus is on you
> to make it clear that you're using it in a non-standard way.

Of course. Nobody should ever say (a least formally) just "pointer" and
expect the entire (assumed diverse) audience to have a common single 
understanding of what is meant. But that applies to most terminology 
like "reference" as well.  It is why language documentation has things 
like definitions and glossaries.

> Some day, most programmers will be using nothing by dynamic languages which
> lack pointers-the-data-type,

I don't think there is any direct relationship between pointers and
dynamic languages. Go is not a dynamic language yet it does not not
allow unrestrained pointer use a'la C.

My impression is that unmanaged pointers (in the C sense) are recognized
these days as dangerous and that nearly all new languages including static
ones manage "pointers" (perhaps under a different name) to prevent the
problems that occur with C.

> and the term will lose its baggage and can be
> safely used as a generic English term for "a thing which points". The tiny
> minority of systems programmers writing device drivers and kernel code in
> Rust (C having been long-since delegated to the wastebin of history -- well
> that's my fantasy and I'm sticking to it)

That's fine, so we are talking about the far distant future, maybe
year 3000 or so. :-)

> will learn that, outside of their
> own niche, "pointer" does not have the technical meaning that they are used
> to, and everyone else will be as blissfully unaware of said technical
> meaning as the average programmer today is of continuations and futures.
> 
> But this is not that day.

I think you underestimate the ability of human beings (even programmers)
to interpret words in a context dependent way.
 
The question is whether what "pointer" means in languages that use the
word is *so* different than its meaning in the Python sense, that using
it for Python is more misleading than helpful. You think so, perhaps
because you focus on the unmanaged and memory-address aspects of its use.
I consider those as non-determining characteristics of a thing that points
to something and instead consider its pointingness to be its defining
characteristic, in those languages and in Python, and thus find it 
perfectly descriptive for Python.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Terminology: "reference" versus "pointer"

2015-09-12 Thread rurpy--- via Python-list
On 09/12/2015 04:14 PM, Emile van Sebille wrote:
> On 9/12/2015 12:58 PM, rurpy--- via Python-list wrote:
> 
>> The question is whether what "pointer" means in languages that use the
>> word is*so*  different than its meaning in the Python sense
> 
> I can't find a single reference to pointer in the python docs outside
> of ctypes.  What is its python sense?

I should have said "proposed sense" (except I don't really mean
proposed as in "let's change all the docs" but as "let's stop the
hissy-fits when someone uses the term"), i.e. the way I, I think
random832, and others use it re python. Sorry, I see in retrospect
my phrasing could be confusing.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Terminology: "reference" versus "pointer"

2015-09-12 Thread rurpy--- via Python-list
On 09/12/2015 05:14 PM, Mark Lawrence wrote:
> On 12/09/2015 23:34, rurpy--- via Python-list wrote:
>> On 09/12/2015 04:14 PM, Emile van Sebille wrote:
>>> On 9/12/2015 12:58 PM, rurpy--- via Python-list wrote:
>>> 
>>>> The question is whether what "pointer" means in languages that
>>>> use the word is*so*  different than its meaning in the Python
>>>> sense
>>> 
>>> I can't find a single reference to pointer in the python docs
>>> outside of ctypes.  What is its python sense?
>> 
>> I should have said "proposed sense" (except I don't really mean 
>> proposed as in "let's change all the docs" but as "let's stop the 
>> hissy-fits when someone uses the term"), i.e. the way I, I think 
>> random832, and others use it re python. Sorry, I see in retrospect 
>> my phrasing could be confusing.
> 
> The "hissy-fits" are caused because Python the language does not have
> pointers, so by definition there is no need to mention them in any
> way, shape or form in any Python thread.

Right. "And our country has no social unrest so there is no need
for any mention of social unrest on our internet." (a common
justification for censorship in some countries.) You can't define
away reality, Bucky.

But the issue is not one that can be expressed as a binary "has" or
"has not". It is about how to best describe how Python works and
what descriptions work best for what groups of people (at least in
my view).

> What is so difficult to understand about that?

You'll find my questions about that in my previous posts. You
can find them here:
https://mail.python.org/pipermail/python-list/2015-September/thread.html
If you have any specific serious questions I'll be happy to try
to answer them for you.

> I would say it's not rocket science, but the
> insurers that paid out over Ariane 5 maybe wouldn't be too happy with
> that.

No clue what the Ariane 5 has to do with Python or how Python
works is described.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Terminology: "reference" versus "pointer"

2015-09-12 Thread rurpy--- via Python-list
On 09/12/2015 05:39 PM, Rustom Mody wrote:
> On Sunday, September 13, 2015 at 4:05:21 AM UTC+5:30, ru...@yahoo.com wrote:
>> On 09/12/2015 04:14 PM, Emile van Sebille wrote:
>>> On 9/12/2015 12:58 PM, rurpy--- via Python-list wrote:
>>>
>>>> The question is whether what "pointer" means in languages that use the
>>>> word is*so*  different than its meaning in the Python sense
>>>
>>> I can't find a single reference to pointer in the python docs outside
>>> of ctypes.  What is its python sense?
>>
>> I should have said "proposed sense" (except I don't really mean
>> proposed as in "let's change all the docs" but as "let's stop the
>> hissy-fits when someone uses the term"), i.e. the way I, I think
>> random832, and others use it re python. Sorry, I see in retrospect
>> my phrasing could be confusing.
> 
> Here is my post a little way up:
> 
> ---
> On Saturday, September 12, 2015 at 10:02:40 PM UTC+5:30, Steven D'Aprano 
> wrote:
> [...]
>> Insisting that Python has pointers is like insisting that you use a text
>> editor by flipping bits. "What happens if I press Ctrl-X?" "Well, these
>> bits on the screen flip from black to white, these bits flip from white to
>> black, and these stay the same."
> 
> This is from the docs
> https://docs.python.org/3/library/functions.html#id
> 
> id(object)
> 
> Return the "identity" of an object. This is an integer which is 
> guaranteed to be unique and constant for this object during its lifetime. Two 
> objects with non-overlapping lifetimes may have the same id() value.
> 
> CPython implementation detail: This is the address of the object in 
> memory.
> 
> ---
> 
> which may be summarized as:
> 1. Steven (quoting Online dictionary): Pointer = Address
> 2. Steven: "Python has pointers" is ridiculous
> 3. Python docs: id returns an address in (C)Python
> 
> To which we have Chris saying CPython ≠ Python
> Which reminds me of another definition
> Fig-Leaf: A device for converting poor porn into high art
> 
> Even in languages like C with an ISO standard adhering to the standard is
> academic (gcc's switch is --pedantic) and it is in practice major 
> implementations like gcc and MSC that define and push the standard.
> 
> In python, CPython is the standard and other implementations can lay claim to
> being 'python' to the extent that they adhere to the standard.
> 
> Or have I missed some ISO-ization?

I have to agree with Steven and Chris here. Among other reasons because
although id() allows you to determine if two objects are the same object,
you can't dereference it to get any access to the object. So id() certainly
doesn't give you something I would call a pointer. And though you are right
about cpython's preeminent position, I don't think one can use that to make
an argument about python-the-language unless it can be shown that implementing
it in some other way would be very difficult.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Terminology: "reference" versus "pointer"

2015-09-12 Thread rurpy--- via Python-list
On 09/12/2015 06:02 PM, Ned Batchelder wrote:
> On Saturday, September 12, 2015 at 7:15:18 PM UTC-4, Mark Lawrence wrote:
> [...]
> But in C, pointers mean more than that.  You can perform arithmetic on
> them, to access memory as a linearly addressed abstraction.  Python has
> nothing like this.
> 
> In C, a pointer can refer to another variable.  Again, Python has
> nothing like this.  Python names refer to values, but they cannot
> refer to other names.
> 
> These last two reasons are why people say that Python does not have
> pointers.
> 
> As a language concept, Python has no pointers, because you cannot have
> names referring to names, and because you cannot perform arithmetic on
> references.  The references from names to values are not things that can
> be manipulated themselves.

The reason python doesn't have pointers is that the majority of developers
and documenters chose not to use the term.

I don't see that pointer arithmetic is necessary to call something a pointer
(and i think someone else said the same earlier). And references to a name
I think that is an artifact of C because in C names and values are inextricably
welded together at compile time -- a pointer to a name is also necessarily a
pointer to a value. Since there are no C pointers to don't point to values
they can provide a way to describe Python "things" that also point to values.

If one acknowledges that those two properties are not intrinsic requirements
for pointerness then describing the things "in" a python object that are used
to identify and dereference other objects, as pointers is not at all 
unreasonable.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Terminology: "reference" versus "pointer"

2015-09-12 Thread rurpy--- via Python-list
On Saturday, September 12, 2015 at 6:25:39 PM UTC-6, ru...@yahoo.com wrote:
> On 09/12/2015 05:39 PM, Rustom Mody wrote:
> [...]
> > which may be summarized as:
> > 1. Steven (quoting Online dictionary): Pointer = Address
> > 2. Steven: "Python has pointers" is ridiculous
> > 3. Python docs: id returns an address in (C)Python
> > 
> > To which we have Chris saying CPython ≠ Python
> > [...]
> I have to agree with Steven and Chris here. 
> [...]

I'm writing too fast.  Just to clarify, I don't of course agree that
python doesn't have pointers (or something that can be labeled as
such), just that the existence of id() and cpython's internal use 
of pointers are not good arguments that it doesn't.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Terminology: "reference" versus "pointer"

2015-09-13 Thread rurpy--- via Python-list
On 09/12/2015 08:42 PM, Ben Finney wrote:
> Michael Torrie  writes:
>> On 09/12/2015 08:22 PM, Mark Lawrence wrote:
>>> You appear to have the same level of knowledge of Python internals as 
>>> the RUE has of the Python 3.3+ FSR unicode implementation.  Let's have 
>>> some fun, is Python pass by value or pass by reference?  It has to be 
>>> more interesting debating that than the drivel that's gone before in 
>>> this thread.
>>
>> Oh you are a devious one there! This should get good.
>
> No, it should stop there. Taunting trolls is no more welcome here than
> trolling.

Ben,

If the troll being taunted here is referring to me, I suggest 
you review my posts in this thread,  You've said in the past 
that you don't read posts from Google Groups (that's fine, 
your choice) so perhaps you do not have a clear idea what I 
have written.

One of the most effective ways for a community to discredit 
itself is to make accusations of trolling in response to 
unpopular but legitimate and reasonable opinion.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Terminology: "reference" versus "pointer"

2015-09-13 Thread rurpy--- via Python-list
On Sunday, September 13, 2015 at 2:49:13 PM UTC-6, Ben Finney wrote:
> Chris Angelico  writes:
> 
> > I think Ben's referring to taunting jmf, whom Mark called the "RUE" or
> > "Resident Unicode Expert". There has been a long-standing antagonism
> > between those two (which is completely understandable), and one which
> > often spills over into vitriolic posts (which is less acceptable).
> 
> Chris has it right.
> 
> What's especially unacceptable is invoking that person for amusement,
> irrelevant to the conversation. It's one thing to respond when a person
> comes into a thread to troll unbidden; it is quite another to taunt them
> unprompted.

Thank you for making that clear.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Terminology: "reference" versus "pointer"

2015-09-13 Thread rurpy--- via Python-list
On 09/13/2015 06:50 AM, Steven D'Aprano wrote:
> On Sun, 13 Sep 2015 04:45 am, ru...@yahoo.com wrote:
>> On 09/12/2015 10:32 AM, Steven D'Aprano wrote:
>>> On Sat, 12 Sep 2015 02:42 pm, Random832 wrote:
>>> [...]
>>> Computer science and IT is *dominated* by a single usage for "pointer" --
>>> it's an abstract memory address. The fundamental characteristics of
>>> pointers are:
>>
>> Just upthread, you claimed something was "universally agreed"
> 
> I did? "Universially agreed" doesn't sound like something I would say. Do
> you have a link to where I said that?
> I think you're confusing me with somebody else. Somebody who is not me.

I should have copy/pasted rather than paraphrasing from memory. You
said "near-universal agreement" ("Re: Python handles globals badly",
2015-09-10). The difference does not change my response at all.

> [...]
> I have little problem with you using "pointer" as a metaphor: "Python
> variables are like pointers in these ways...". I do have a problem with you
> insisting that they are pointers.

First, I am very cautious about about using absolute and dogmatic
words like *are* [pointers] (although I probably have occasionally
for brevity or in response to someones else's dogmatism.)

If you go back over what I've written, I think you'll see that my
main point is that describing what is in python "variables" and objects
as pointers can be useful in some circumstances as an alternative
to the current official description (with people who have had some
experience with pointers in other languages, for example).

The "standard definition" you keep referring to (and basing your
arguments on was):

  An address, from the point of view of a programming language.[...]

Wikipedia also seems to define pointer in terms of memory address.
As I said, I think when describing the behavior of a language in abstract
terms it is perfectly valid to take "address" equally abstractly (eg a
token that lets you retrieve the same data every time you use it) but
unfortunately for me Wikipedia defines "address" as the conventional
linear numbers used in real-world computers. And I am not going to
waste my time trying to convince anyone that Wikipedia is wrong or
the context in inappropriate.

Wikipedia also makes a distinction between "pointer" as something
that refers to some data by "memory address" and "reference" which
refers to some data by any means (including but not limited to a
memory address, eg offset from current address or url). That was
not distinction I knew of; I considered both terms as being more or
less synonymous (in the general sense, obviously they are different
in specific domains like C++).

So I will retract any claim I made about "pointer" being a technically
correct term (because Python-the-language imposes no restrictions on
on how references are implemented.)

Nevertheless I'll continue to maintain that it is useful to explain
how python works in terms of pointers in that:

1) The distinction between abstract pointers(*) and references
is non-existant or irrelevant in Python for any existing
implementation.

2) You can accurately specify python-the-language in term of
abstract pointers (ie, "as if") regardless of how it is currently
specified.

3) People who've used pointers in other languages are more easily
able to grasp Python semantics when presented in term of pointers,
a concept they already understand.

(*) by "abstract pointers" I mean pointers in the sense given in
your definition, not C datatype pointers. If you insist on "references"
that's ok too, the description can be accompanied with a wink and a
whispered, "hey, references are really like pointers".)

Those are my opinions, if you have any clear counter examples I
would certainly like to know of them but I've not seen or read
anything yet that indicates they are wrong.

Below I snipped out all your responses that were essentially "that's
not the standard definition of pointers", having addressed those above.

> [...]

>> It may not be appropriate way to describe Python for everybody but
>> it is perfectly reasonable (and even preferable) for people with
>> an understanding of "pointers" from some other language. And for
>> those people who don't then one could argue they are a clean slate
>> and using the word "pointer" won't hurt.
> 
> No, it is not reasonable. 
> 
> You want to insist that `x = 23` in Python code makes x a pointer. But that
> Python snippet is analogous to to the following C and Pascal snippets:
> 
> # C
> int x = 23;
> 
> [...pascal example snipped...]
> 
> Do you insist that they are pointers to? 
>
> Then everything is a pointer, and the word has no meaning.
>
> Regardless of which of the three languages we are talking about, the
> assignment `x = 23` does not mean "bind some value to x which, when
> dereferenced, gives the value 23".
>
> The value bound to x is 23, not some
> indirect pointer to 23.

Your problem is that the C snippet is not, as you claim, analogous
to the Python snippet

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-14 Thread rurpy--- via Python-list
On Monday, September 14, 2015 at 5:23:32 PM UTC-6, Laura Creighton wrote:
>[...]
> I don't know about the others, but I am finding this rather more
> entertaining than another round of 'python -- does it have pointers'
> in python-list.

Could we please dispense with the gratuitous "what I'm interested 
in is more important that what you are interested in" posts please?
Almost all mail readers have a filter ability that will address the
problem more effectively.

Thank you.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: installer user interface glitch ?

2015-11-01 Thread rurpy--- via Python-list
On 11/01/2015 03:06 AM, Chris Warrick wrote:
> On 1 November 2015 at 09:23, t_ciorba--- via Python-list 
>  wrote:
>> 
>> hi, i am not sure what is wrong, but after launching the installer
>> for windows XPsp3 python-3.5.0.exe i couldnt see what i have to
>> select, it was a white board and the only button on it was
>> "cancel". here is a screen of it:
> 
> Windows XP is not supported. Please upgrade to a modern version of 
> Windows, or switch to Linux. (you could also use 3.4.3, but Windows
> XP is insecure, and more apps will follow suit.)

Why, oh why, do the python.org front page and other pages that offer
a Windows download not say a word about it not running on Windows XP?

Even if one is anal enough to go to the page about the 3.5 release.
  https://www.python.org/downloads/release/python-350/
a page with a lot of Windows-specific info, there is not a word
about XP.

Or perhaps the number of posts to this list are declining and having
people download Python-3.5, have it fail, and then ask why here is
part of a secret plan to increase list volume?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: installer user interface glitch ?

2015-11-01 Thread rurpy--- via Python-list
On Sunday, November 1, 2015 at 8:52:55 AM UTC-7, Chris Angelico wrote:
> On Mon, Nov 2, 2015 at 2:43 AM, rurpy--- via Python-list 
>  wrote:
> > Why, oh why, do the python.org front page and other pages that offer
> > a Windows download not say a word about it not running on Windows XP?
> >
> > Even if one is anal enough to go to the page about the 3.5 release.
> >   https://www.python.org/downloads/release/python-350/
> > a page with a lot of Windows-specific info, there is not a word
> > about XP.
> 
> A partial answer to that is in PEP 11:
> 
> https://www.python.org/dev/peps/pep-0011/#microsoft-windows
> 
> Windows XP isn't special here. There's no mention of Python 2.7 not
> working on Windows 95, because it's simply an unsupported operating
> system. The only reason that people keep coming asking about XP and
> not (say) Win2K is that there are a lot more XP boxes out there. Do
> the other download pages need to stipulate which versions of which
> OSes they support, or should that be left up to the installer?

I dont recall seeing anyone posting asking why they could not get 
Python to install on Windows 95 recently.  I only read this group
intermittently but I have seen *many* posts asking why they couldnt
install on XP.

You acknowledge yourself: "there are a lot more XP boxes out there."

> There *is* a plan to have the installer give a better error message
> for this situation.

A better message from the installer is necessary but not sufficient.
Don't make people go through the effort to download the whole thing,
do their planning and preparations for using or upgrading Python 
only to discover at the last moment it wont work.

That is really shitty customer relations.

The reality is that people trying install Python-3.5 on XP *is* a 
problem.  Telling them they should have read some obscure release 
notes is not a solution.

> But I don't think the web site necessarily has to
> have noise about old versions of OSes. Where would you draw the line?

I think my responses above answer that.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: installer user interface glitch ?

2015-11-01 Thread rurpy--- via Python-list
On 11/01/2015 09:43 AM, Chris Angelico wrote:
> On Mon, Nov 2, 2015 at 3:24 AM, rurpy--- via Python-list 
>  wrote:
>> I dont recall seeing anyone posting asking why they could not get
>> Python to install on Windows 95 recently.  I only read this group
>> intermittently but I have seen *many* posts asking why they couldnt
>> install on XP.
>>
>> You acknowledge yourself: "there are a lot more XP boxes out there."
> 
> Yes, there are. This is not a customer base; they are not paying me,
> nor (as far as I know) the PSF, to support them.

I wasn't asking *you* to do anything. And I wasn't asking for python
to support XP. I'm not sure how you have possibly got that idea.
In fact I wasn't *asking* anyone to do anything.

I was pointing out (the obvious) that there was a problem with people
not understanding that Python-3.5 will not run on XP and suggesting a
low-cost way to reduce that problem.

>>> There *is* a plan to have the installer give a better error message
>>> for this situation.
>>
>> A better message from the installer is necessary but not sufficient.
>> Don't make people go through the effort to download the whole thing,
>> do their planning and preparations for using or upgrading Python
>> only to discover at the last moment it wont work.
> 
> The largest installer [1] is 30MB, which might have been considered
> large a decade ago, but on today's connections, that's probably going
> to download in less time than it takes people to search for "python",
> find python.org, and decide to click the download link. The web
> installer is less than one megabyte. If you can't afford to download a
> single meg of executable to find out whether something works on your
> system, you probably can't afford to download the page with the info
> telling you not to bother downloading the binary.

As I said it is not solely the number of minutes needed to download
something.

And not everyone in the world has high-speed reliable connection.
It wasn't that long ago my internet connection was a modem. And
even today with screaming fast 100KB/s (sometimes) connection I often
have to babysit a download to get it to complete or deal with long
outages. There are plenty of places much less connected than I am.
And of course those are the same places where people are more likely
to still be using XP.

>> That is really shitty customer relations.
> 
> See above, and define 'customer'.

customer: the people to whom you are providing a product or service.

Of course, unless the PSF has a charter that imposes some legal
requirements, PSF/Python development community has no legal
obligation to do anything for anyone. They could add spam-ware
to the installer, make backward incompatible changes on a whim,
release software that crashes when started.

Now could we return to reality please?

>> The reality is that people trying install Python-3.5 on XP *is* a
>> problem.  Telling them they should have read some obscure release
>> notes is not a solution.
> 
> Nor is telling them they should have read the web site that they
> downloaded it from. Remember, people can click a direct download link
> *on the python.org front page* and be immediately downloading Python 2
> or 3 for the OS that the browser announces. 

Where is that? I didn't see anything that wasn't accompanied with text
that could accommodate a windows xp warning. But then I was looking
at it from a Linux machine. And even if it is impossibly awkward to
provide in one case (though I doubt that's the case), there certainly
should be a warning on the windows specific pages.

AFAIK, the only place where dropping XP support is mentioned in the
docs is way down the bottom of What's New. PEP-11 doesn't count --
it unrealistic in the extreme to expect a Windows user who wants to
try Python to read (or even know about) the PEPs, or that one of
them describes supported OSes.

> Where would you put the
> big fat noisy warning?

I would not put a "big fat noisy warning" anywhere. I would put a
minimally sized but clear notice where the windows version of python-3.5
can be downloaded.
 
>>> But I don't think the web site necessarily has to
>>> have noise about old versions of OSes. Where would you draw the line?

What noise? Providing basic useful information to a significant
number of customers/clients/users, information that is not provided
elsewhere in the normal course of their actions, is not "noise".

If you want to get rid of noise, how about ditching corporate-style
PR like "Success Stories", or a big graphic of fibonacci numbers in
python?

It's really sad to see open source projects taken over by marketing
wanna-bees who think PR fluff

Re: installer user interface glitch ?

2015-11-02 Thread rurpy--- via Python-list
On Sunday, November 1, 2015 at 2:48:58 PM UTC-7, Laura Creighton wrote:
> Actually, adding the XP - do not look here --
> message for several webpages has been on the pydotorg
> todo list for more than a week now.
> 
> Not sure why it hasn't happened.
> 
> Thank you for the reminder.

You're welcome.  And thanks for the reasonable response.  Everytime
I post to this list it is like stepping into Alice's Wonderland so
it is a nice change.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Regular expressions

2015-11-02 Thread rurpy--- via Python-list
On 11/02/2015 08:51 PM, Michael Torrie wrote:
>[...]
> Indeed, sometimes Jamie Zawinski's is often quite appropriate:
> 
> Some people, when confronted with a problem, think "I know, I'll use
> regular expressions." Now they have two problems.

Or its sometimes heard paraphrase:
  Some people, when confronted with a problem, think "I know, I'll use
  Python." Now they have two problems
The point being it's a cute and memorable aphorism but not very meaningful
because it can be applied to anything one wishes to denigrate.

Of course there are people who misuse regexes. But I am quite sure,
especially in the Python community, there are just as many who fail to
use them when they are appropriate which is just as bad.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Regular expressions

2015-11-02 Thread rurpy--- via Python-list
On Monday, November 2, 2015 at 8:58:45 PM UTC-7, Joel Goldstick wrote:
> On Mon, Nov 2, 2015 at 10:17 PM, Seymore4Head 
> wrote:
> 
> > On Mon, 2 Nov 2015 20:42:37 -0600, Tim Chase
> >  wrote:
> >
> > >On 2015-11-02 20:09, Seymore4Head wrote:
> > >> How do I make a regular expression that returns true if the end of
> > >> the line is an asterisk
> > >
> > >Why use a regular expression?
> > >
> > >  if line[-1] == '*':
> > >yep(line)
> > >  else:
> > >nope(line)
> > >
> > >-tkc
> > >
> > >
> > Because that is the part of Python I am trying to learn at the moment.
> > Thanks
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
> 
> My completely unsolicited advice is that regular expressions shouldn't be
> very high on the list of things to learn.  They are very useful, and very
> tricky and prone many problems that can and should be learned to be
> resolved with much simpler methods.  If you really want to learn regular
> expressions, that's great but the problem you posed is not one for which
> they are the best solution.  Remember simpler is better than complex.

Regular expressions should be learned by every programmer or by anyone
who wants to use computers as a tool.  They are a fundamental part of
computer science and are used in all sorts of matching and searching 
from compilers down to your work-a-day text editor.

Not knowing how to use them is like an auto mechanic not knowing how to 
use a socket wrench.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Regular expressions

2015-11-03 Thread rurpy--- via Python-list
On 11/03/2015 12:15 AM, Steven D'Aprano wrote:
> On Tue, 3 Nov 2015 03:23 pm, rurpy wrote:
> 
>> Regular expressions should be learned by every programmer or by anyone
>> who wants to use computers as a tool.  They are a fundamental part of
>> computer science and are used in all sorts of matching and searching
>> from compilers down to your work-a-day text editor.
> 
> You are absolutely right.
> 
> If only regular expressions weren't such an overly-terse, cryptic
> mini-language, with all but no debugging capabilities, they would be great.
> 
> If only there wasn't an extensive culture of regular expression abuse within
> programming communities, they would be fine.
> 
> All technologies are open to abuse. But we don't say:
> 
>   Some people, when confronted with a problem, think "I know, I'll use
>   arithmetic." Now they have two problems.
> 
> because abuse of arithmetic is rare. It's hard to misuse it, and while
> arithmetic can be complicated, it's rare for programmers to abuse it. But
> the same cannot be said for regexes -- they are regularly misused, abused,
> and down-right hard to use right even when you have a good reason for using
> them:
> 
> http://www.thedailywtf.com/articles/Irregular_Expression
> 
> http://blog.codinghorror.com/regex-use-vs-regex-abuse/
> 
> http://psung.blogspot.com.au/2008/01/wonderful-abuse-of-regular-expressions.html

Thanks for pointing out three cases of misuse of regexes out of the
approximately 37500 [*] uses of regexes in the wild. I hope you're
not dumb enough to think that constitutes significant evidence.

Even worse, of the three only one was a real example. One of the others
was machine-generated code, the other was a "look what you can do with
regexes" example, not serious code.

Here is an example of "abusing" python

  https://benkurtovic.com/2014/06/01/obfuscating-hello-world.html

I wouldn't use this as evidence that Python is to be avoided.

> If there is one person who has done more to create a regex culture, it is
> Larry Wall, inventor of Perl. Even Larry Wall says that regexes are
> overused and their syntax is harmful, and he has recreated them for Perl 6:
> 
> http://www.perl.com/pub/2002/06/04/apo5.html

You really should have read beyond the first paragraph. He proposes
fixing regexes by adding even more special character combinations and
making regexes even *more* powerful. (He turned them into full-blown
parsers.)

Nowhere does he advocate not using, or avoiding if possible, regexes
as is the mantra in this list.

Here is Larry's "recreation" that you are touting:

  http://design.perl6.org/S05.html

Please explain to us how you think this "fix" addresses the complaints
you and other Python anti-regexers have about regexes.

I hope you also noted Larry's tongue-in-cheek writing style. Right after
pointing out that some claim Perl is hard to read due largely to regex
syntax, he writes:

  "Funny that other languages have been borrowing Perl's regular
  expressions as fast as they can..."

So I don't think you can claim Larry Wall as a supporter of this list's
anti-regex attitude beyond some superficial verbiage taken out of context.

> Oh, and the icing on the cake, regexes can be a security vulnerability too:
> https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS

And here is a list of CVEs involving Python. There are (at time of
writing) 190 of them.

  http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=python

So if a security vulnerability is reason not to use regexes, we should
all be *running* from Python. I sure you'll point out that most have
been fixed.

But you failed to point out that same is true of regex engines. From
your source:

  "Notice, that not all algorithms are naïve, and actually Regex
  algorithms can be written in an efficient way."

And in fact, again, had you looked beyond a headline that suited your
purpose, you could have tried the "Evil Regexes" noted in that source
and discovered none of them are a DoS in Python.

Even were that not true, normal practice applies: if the input is
untrusted then sanitize it, or mitigate the threat by imposing a timeout,
etc. Not exactly a problem or solution unique to regexes. And common
sense should tell you that since there are a lot of "try a regex" web
sites, this is not a problem without a solution.

And *certainly* not a reason not to use them in the *far* more common
case when they *are* trusted because you are in control of them,

Finally, preemptively, I'll repeat I acknowledge regexs are not the
the optimum solution in every case where they could be used. But they
are very useful when one passes the border of the trivial; and they are
nowhere near as bad as routinely portrayed here.


[*] Yes, I made that number up.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Regular expressions

2015-11-03 Thread rurpy--- via Python-list
On Monday, November 2, 2015 at 9:38:24 PM UTC-7, Michael Torrie wrote:
> On 11/02/2015 09:23 PM, rurpy--- via Python-list wrote:
> >> My completely unsolicited advice is that regular expressions shouldn't be
> >> very high on the list of things to learn.  They are very useful, and very
> >> tricky and prone many problems that can and should be learned to be
> >> resolved with much simpler methods.  If you really want to learn regular
> >> expressions, that's great but the problem you posed is not one for which
> >> they are the best solution.  Remember simpler is better than complex.
> > 
> > Regular expressions should be learned by every programmer or by anyone
> > who wants to use computers as a tool.  They are a fundamental part of
> > computer science and are used in all sorts of matching and searching 
> > from compilers down to your work-a-day text editor.
> > 
> > Not knowing how to use them is like an auto mechanic not knowing how to 
> > use a socket wrench.
> 
> Not quite.  Core language concepts like ifs, loops, functions,
> variables, slicing, etc are the socket wrenches of the programmer's
> toolbox.  Regexs are like an electric impact socket wrench.  You can do
> the same work without it, but in many cases it's slower. But you have to
> learn the other hand tools first in order to really use the electric
> driver properly (understanding torques, direction of threads, etc), lest
> you wonder why you're breaking off so many bolts with the torque of the
> impact drive.

I consider regexs more fundemental.  One need not even be a programmer
to use them: consider grep, sed, a zillion editors, database query 
languages, etc.

When there is a mini-language explicitly developed for describing
string patterns, why, except is very simple cases, would one not
take advantage of it?  Beyond trivial operations a regex, although
terse (overly perhaps), is still likely to be more understandable 
more maintainable than bunch of ad-hoc code.  And the relative ease 
of expressing complex patterns means one is more likely to create
more specific patterns, resulting in detecting unexpected input 
earlier than with ad-hoc code. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Creating PST files using Python

2015-11-03 Thread rurpy--- via Python-list
On 11/03/2015 12:09 PM, Anthony Papillion wrote:
> Does anyone know of a module that allows the wiring of Outlook PST
> files using Python? I'm working on a project that will require me to
> migrate 60gb of maildir mail (multiple accounts) to Outlook.

I used libpst (http://www.five-ten-sg.com/libpst/) a few years ago
successfully but I was going in the other direction (outlook -> maildir)
so not sure if it does writing of pst files. 
At the time I also looked into libpff which (from my notes, I don't
remember much of this work) was newer but the documentation was pretty
thin and it wasn't worth the time to figure out how to use it.
Of course things may have changed since then...

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Creating PST files using Python

2015-11-03 Thread rurpy--- via Python-list
I should have checked the web site before posting, it
appears that both libpst and libpff only read pst files,
no write.  Sorry for the noise.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Regular expressions

2015-11-04 Thread rurpy--- via Python-list
On 11/03/2015 08:48 PM, Steven D'Aprano wrote:
> On Wednesday 04 November 2015 11:33, rurpy wrote:
>
>>> Not quite.  Core language concepts like ifs, loops, functions,
>>> variables, slicing, etc are the socket wrenches of the programmer's
>>> toolbox.  Regexs are like an electric impact socket wrench.  You can do
>>> the same work without it, but in many cases it's slower. But you have to
>>> learn the other hand tools first in order to really use the electric
>>> driver properly (understanding torques, direction of threads, etc), lest
>>> you wonder why you're breaking off so many bolts with the torque of the
>>> impact drive.
>>
>> I consider regexs more fundemental
>
> I'm sure that there are people who consider the International Space Station 
> more fundamental than the lever, the wedge and the hammer, but they would be 
> wrong too.
>
> Given primitives for branching, loops and variables, you can build support 
> for regexes. Given regexes, how would you build support for variables?
>
> Of course, you could easily prove me wrong. All you would need to do to 
> demonstrate that regexes are more fundamental than branching, loops and 
> variables would be to demonstrate that the primitive operations available in 
> commonly used CPUs are regular expressions, and that (for example) C's for 
> loop and if...else are implemented in machine code as regular expressions, 
> rather than the other way around.

I'm afraid you are making a category error but perhaps that's in 
part because I wasn't clear.  I was not talking about computer 
science.  I was talking about human beings learning about computers.  
Most people I know consider programming to be a higher level activity 
than "using" a computer: editing, sending email etc.  Many computer
users (not programmers) learn to use regular expressions as part
of using a computer without knowing anything about programming.
It was on that basis I called them more fundamental -- something
learned earlier which is expanded on and added to later.  But you
have a bit of a point, perhaps "fundamental" was not the best choice
of word to communicate that.

Here is what I wrote:

> I consider regexs more fundemental.  One need not even be a programmer
> to use them: consider grep, sed, a zillion editors, database query 
> languages, etc.

I thought the context, which you removed even to the point cutting 
text from the very same line you quoted, made that clear but perhaps
not.

Indeed it is quite eye-opening when one does learn a little CS and 
discovers these things that were just a useful "feature" actually have 
a deep and profound theoretical basis.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Regular expressions

2015-11-04 Thread rurpy--- via Python-list
On Wednesday, November 4, 2015 at 1:52:31 AM UTC-7, Steven D'Aprano wrote:
> On Wednesday 04 November 2015 18:21, Christian Gollwitzer wrote:
> 
> > What rurpy meant, was that regexes can surface to a computer user
> > earlier than variables and branches; a user who does not go into the
> > depth to actually program the machine, might still encounter them in a
> > text editor or database engine. Even some web forms allow some limited
> > form, like e.g. the DVD rental here or Google.
> [...]
> What *I* think that Rurpy means is that one can construct a mathematical 
> system based on pattern matching which is Turing complete, and therefore in 
> principle any problem you can solve using a program written in (say) Python, 
> C, Lisp, Smalltalk, etc, or execute on a CPU (or simulate in your head!) 
> could be written as a sufficiently complex regular expression.

No, Christian was correct.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Regular expressions

2015-11-04 Thread rurpy--- via Python-list
On 11/04/2015 07:52 AM, Chris Angelico wrote:
> On Thu, Nov 5, 2015 at 1:38 AM, rurpy wrote:
>> I'm afraid you are making a category error but perhaps that's in
>> part because I wasn't clear.  I was not talking about computer
>> science.  I was talking about human beings learning about computers.
>> Most people I know consider programming to be a higher level activity
>> than "using" a computer: editing, sending email etc.  Many computer
>> users (not programmers) learn to use regular expressions as part
>> of using a computer without knowing anything about programming.
>> It was on that basis I called them more fundamental -- something
>> learned earlier which is expanded on and added to later.  But you
>> have a bit of a point, perhaps "fundamental" was not the best choice
>> of word to communicate that.
>
> The "fundamentals" of something are its most basic functions, not its
> most basic uses. The most common use of a computer might be to browse
> the web, but the fundamental functionality is arithmetic and logic.

If one accepted that then one would have to reject the term "fundamental 
use" as meaningless.  A quick trip to google shows that's not true.

> Setting aside the choice of word, though, I still don't think regular
> expressions are a more basic use of computing than loops and
> conditionals. A regex can't be used for anything other than string
> matching; they exist for one purpose, and one purpose only: to answer
> the question "Does this string match this pattern?". 

But string matching *is* a fundamental problem that arises frequently
in many aspects of CS, programming and, as I mentioned, day-to-day
computer use.  Saying its "only" for pattern matching is like saying 
floating point numbers are "only" for doing non-integer arithmetic,
or unicode is "only" for representing text.  (Neither of those is a 
good analogy because both lack the important theoretical underpinnings 
that regular expressions have [*]).
There would be far fewer computer languages, and they would be much
more primitive if regular expressions (and the fundamental concepts
that they express) did not exist.

To be sure, I did gloss over Michael Torries' point that there are 
other concepts that are more basic in the context of learning 
programming, he was correct about that. 

But that does not negate the fact that regexes are important and 
fundamental.  They are both very useful in a practical sense (they 
are even available in Microsoft Excel) and important in a theoretical 
sense.  You are not well rounded as a programmer if you decline to 
learn about regular expressions because "they are too cryptic", or 
"I can do in code anything they do".  

I think the constant negative reception the posters receive here when
they ask about regexes does them a great disservice.

By all means point out that python offers a number of functions that 
can avoid the need for using regexes in simple cases.  Even point out 
that you (the plural you) don't like them and prefer other solutions
(like writing code that does the same thing in a more half-assed bug
ridden way, the posts in this thread being a case in point.)

But I really wish every mention of regexes here wasn't reflexively 
greeted with a barrage of negative comments and that lame "two problems"
quote, especially without an answer to the poster's regex question.

> Sure, you can
> abuse that into a primality check and other forms of crazy arithmetic,
> but it's not what they truly do. I also would not teach regexes to
> people as part of an "introduction to computing" course, any more than
> I would teach the use of Microsoft Excel, which some such courses have
> been known to do. (And no, it's not because of the Microsoftness. I
> wouldn't teach LibreOffice Calc either.) You don't need to know how to
> work a spreadsheet as part of the basics of computer usage, and you
> definitely don't need an advanced form of text search.

Seems to me that clearly depends on the intent of the class, the students
goal's, what they'll be studying after the class, what their current 
level of knowledge is, etc.  Your scenario seems way too under-specified
to say anything definitive.  And further, the pedagogy of CS (or of any 
subject of education) is not "settled science" and that kind of question
almost never has a clear right/wrong answer.

This list is not a class.  If someone comes here with a question about 
Python's regexes they deserve an answer and not be bombarded with reasons
why they shouldn't be using regexes beyond mentioning some of the alternatives
in a "oh, by the way" way.  (And yes, I recognize in this case the OP did 
get a good answer from MRAB early on.)


[*] yes, I know there is a lot of CS theory underlying floating point.
I don't think it is as deep or as important as that underlying regexes,
automata and language.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Regular expressions

2015-11-04 Thread rurpy--- via Python-list
On Wednesday, November 4, 2015 at 4:05:06 PM UTC-7, Seymore4Head wrote:
>[...]
> I am still here, but I have to admit I am not picking up too much.

The "take away" I recommend is: the folks here are often way 
overly negative regarding regular expressions and that you not
ignore them, but take them with a BIG grain of salt and continue 
learning about and using regexs.

You will find they are an indispensable tool, not just in Python 
programming but in many aspects of computer use.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Regular expressions

2015-11-04 Thread rurpy--- via Python-list
On 11/04/2015 05:33 PM, Chris Angelico wrote:
> On Thu, Nov 5, 2015 at 11:13 AM, rurpy--- via Python-list
>  wrote:
>> On 11/04/2015 07:52 AM, Chris Angelico wrote:
>>> On Thu, Nov 5, 2015 at 1:38 AM, rurpy wrote:
>>>> I'm afraid you are making a category error but perhaps that's in
>>>> part because I wasn't clear.  I was not talking about computer
>>>> science.  I was talking about human beings learning about computers.
>>>> Most people I know consider programming to be a higher level activity
>>>> than "using" a computer: editing, sending email etc.  Many computer
>>>> users (not programmers) learn to use regular expressions as part
>>>> of using a computer without knowing anything about programming.
>>>> It was on that basis I called them more fundamental -- something
>>>> learned earlier which is expanded on and added to later.  But you
>>>> have a bit of a point, perhaps "fundamental" was not the best choice
>>>> of word to communicate that.
>>>
>>> The "fundamentals" of something are its most basic functions, not its
>>> most basic uses. The most common use of a computer might be to browse
>>> the web, but the fundamental functionality is arithmetic and logic.
>>
>> If one accepted that then one would have to reject the term "fundamental
>> use" as meaningless.  A quick trip to google shows that's not true.
>
> A quick trip to Google showed me that there are a number of uses of
> the phrase, mostly in scientific papers and such. I've no idea how
> that helps your argument.

I was showing that your objection to my use of "fundamental" on the 
grounds it does not apply to "use" is patently silly.  From Google:

   interferes with B's more fundamental use because
   fundamental use of english
   The fundamental use of testing
   Fundamental Use of the Michigan Terminal System
   negotiate a fundamental use and exchange of power
   the most fundamental use of pointers
   makes fundamental use of statistical theory

This is what I meant in a recent post when I referred to the Alice-
in-Wonderland nature of this group.  I'm afraid I don't have the 
time or interest to discuss basic english with you.  If you want 
to maintain that "fundamental" does apply to "use" please go right
ahead, it's your credibility at risk.

>> But string matching *is* a fundamental problem that arises frequently
>> in many aspects of CS, programming and, as I mentioned, day-to-day
>> computer use.  Saying its "only" for pattern matching is like saying
>> floating point numbers are "only" for doing non-integer arithmetic,
>> or unicode is "only" for representing text.  (Neither of those is a
>> good analogy because both lack the important theoretical underpinnings
>> that regular expressions have [*]).
>
> String matching does happen a lot. How often do you actually need
> pattern matching? Most of the time, you're doing equality checks - or
> prefix/suffix checks, at best.
>
>> There would be far fewer computer languages, and they would be much
>> more primitive if regular expressions (and the fundamental concepts
>> that they express) did not exist.
>
> So? There would also be far fewer computer languages if braces didn't
> exist, because we wouldn't have the interminable arguments about
> whether they're good or not.

Sorry, that makes no sense to me.  

>> To be sure, I did gloss over Michael Torries' point that there are
>> other concepts that are more basic in the context of learning
>> programming, he was correct about that.
>>
>> But that does not negate the fact that regexes are important and
>> fundamental.  They are both very useful in a practical sense (they
>> are even available in Microsoft Excel) and important in a theoretical
>> sense.  You are not well rounded as a programmer if you decline to
>> learn about regular expressions because "they are too cryptic", or
>> "I can do in code anything they do".
>
> You've proven that they are important, but in no way have you proven
> them fundamental. A regular expression library is the ideal solution
> to the problem "I want to let my users search for patterns of their
> own choosing". That's great, but it's only one specific class of
> problem.

If you think that is the sole use of pattern matching or even the most
important use, I can understand why you find regexes fairly useless.
Lexing (tokenization) and simple parsing are often done with regular
expressions.  Many do

Re: Regular expressions

2015-11-04 Thread rurpy--- via Python-list
On Wednesday, November 4, 2015 at 7:31:34 PM UTC-7, Steven D'Aprano wrote:
> On Thu, 5 Nov 2015 11:13 am, rurpy wrote:
> 
> > There would be far fewer computer languages, and they would be much
> > more primitive if regular expressions (and the fundamental concepts
> > that they express) did not exist.
> 
> Well, that's certainly true. But only because contra-factual statements can
> imply the truth of anything. If squares had seven sides, then Joseph Stalin
> would have been the first woman to go to the moon on horseback.

Yes, thank you for that profoundly insightful comment.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Regular expressions

2015-11-04 Thread rurpy--- via Python-list
On 11/04/2015 07:24 PM, Steven D'Aprano wrote:
> On Thu, 5 Nov 2015 11:24 am, wrote:
>
>> You will find they are an indispensable tool, not just in Python
>> programming but in many aspects of computer use.
>
> You will find them a useful tool, but not indispensable by any means.
>
> Hint:
>
> - How many languages make arithmetic a built-in part of the language? Almost
> all of them. I don't know of any language that doesn't let you express
> something like "1 + 1" using built-in functions or syntax. Arithmetic is
> much closer to indispensable.

By my count there are 2377.  That's counting rpn languages where it is
1 1 +.  If you don't count them it is 2250.

> - How many languages make regular expressions a built-in part of the
> language? Almost none of them. There's Perl, obviously, and its
> predecessors sed and awk, and probably a few others, but most languages
> relegate regular expressions to a library.

Yes, like python relegates io to a library.  
Clearly useful but not indispensable, after all who *really* needs 
anything beyond print() and input().  And that stuff in math like sin()
and exp().  How many programs use that geeky trig stuff?  Definitely not 
indispensable.  In fact, now that you pointed it out to me, clearly all
that stdlib stuff is dispensable, all one really needs to write 
"real programmer" programs is just core python.  Who the hell needs "sys"!

> - How many useful programs can be written with regexes? Clearly there are
> many. Some of them would even be quite difficult without regexes. (In
> effect, you would have to invent your own pattern-matching code.)

Lucky for me then that there are regexes.

> - How many useful programs can be written without regexes? Clearly there are
> also many. Every time you write a Python program and fail to import re,
> you've written one.

By golly, you're right.  Not every program I write uses regexes.
Who would have thought?!  However, you failed to establish that 
the programs I write without re are useful.

> Can you call yourself a well-rounded programmer without at least a basic
> understanding of some regex library? Well, probably not. But that's part of
> the problem with regexes. They have, to some degree, driven out potentially
> better -- or at least differently bad -- pattern matching solutions, such
> as (E)BNF grammars, SNOBOL pattern matching, or lowly globbing patterns. Or
> even alternative idioms, like Hypercard's "chunking" idioms.

Hmm, very good point.  I wonder why all those "potentially better" 
solutions have not been more widely adopted?  A conspiracy by a 
secret regex cabal? 

> When all you have is a hammer, everything looks like a nail.

Lucky for us then, that we have more than just hammers!

Sorry for the flippant response (well, not really) but I find your 
arguments pedantic beyond the point of absurdity.  For me, regular 
expressions are indispensable in that if they were not available in 
Python I would not use Python.  The same is true of a number of other 
stdlib modules.  I don't give a rat's ass whether they are in a 
"library" that has to be explicitly requested with import or a 
"library" that is automatically loaded at startup.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Regular expressions

2015-11-04 Thread rurpy--- via Python-list
On Wednesday, November 4, 2015 at 7:46:24 PM UTC-7, Chris Angelico wrote:
> On Thu, Nov 5, 2015 at 11:24 AM, rurpy wrote:

> The "take away" that I recommend is: Rurpy loves to argue in favour of
> regular expressions,

No, I don't love it, I quite dislike it.

> but as you can see from the other posts, there
> are alternatives, which are often FAR superior.

No, not FAR superior, just preferable and just in the simple cases,
regexes generally being better in anything beyond simple. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Regular expressions

2015-11-06 Thread rurpy--- via Python-list
On 11/05/2015 01:18 AM, Christian Gollwitzer wrote:
> Am 05.11.15 um 06:59 schrieb rurpy:
>>> Can you call yourself a well-rounded programmer without at least
>>> a basic understanding of some regex library? Well, probably not.
>>> But that's part of the problem with regexes. They have, to some
>>> degree, driven out potentially better -- or at least differently
>>> bad -- pattern matching solutions, such as (E)BNF grammars,
>>> SNOBOL pattern matching, or lowly globbing patterns. Or even
>>> alternative idioms, like Hypercard's "chunking" idioms.
>> 
>> Hmm, very good point.  I wonder why all those "potentially better" 
>> solutions have not been more widely adopted?  A conspiracy by a 
>> secret regex cabal?
> 
> I'm mostly on the pro-side of the regex discussion, but this IS a
> valid point. regexes are not always a good way to express a pattern,
> even if the pattern is regular. The point is, that you can't build
> them up easily piece-by-piece. Say, you want a regex like "first an
> international phone number, then a name, then a second phone number"
> - you will have to *repeat* the pattern for phone number twice. In
> more complex cases this can become a nightmare, like the monster that
> was mentioned before to validate an email.
> 
> A better alternative, then, is PEG for example. You can easily write
> [...]

That is the solution adopted by Perl 6. I have always thought lexing
and parsing solutions for Python were a weak spot in the Python eco-
system and I was about to write that I would love to see a PEG parser
for python when I saw this:

http://fdik.org/pyPEG/

Unfortunately it suffers from the same problem that Pyparsing, Ply
and the rest suffer from: they use Python syntax to express the
parsing rules rather than using a dedicated problem-specific syntax
such as you used to illustrate peg parsing:

> pattern <- phone_number name phone_number phone_number <- '+' [0-9]+
> ( '-' [0-9]+ )* name <-  [[:alpha:]]+

Some here have complained about excessive brevity of regexs but I
much prefer using problem-specific syntax like "(a*)" to having to
express a pattern using python with something like

star = RegexMatchAny()
a_group = RegexGroup('a' + star)
...

and I don't want to have to do something similar with PEG (or Ply
or Pyparsing) to formulate their rules.

>[...]
> As a 12 year old, not knowing anything about pattern recognition, but
> thinking I was the king, as is usual for boys in that age, I sat down
> and manually constructed a recursive descent parser in a BASIC like
> language. It had 1000 lines and took me a few weeks to get it
> correct. Finally the solution was accepted as working, but my
> participation was rejected because the solutions lacked
> documentation. 16 years later I used the problem for a course on
> string processing (that's what the PDF is for), and asked the
> students to solve it using regexes. My own solution consists of 67
> characters, and it took me5 minutes to write it down.
> 
> Admittedly, this problem is constructed, but solving similar tasks by
> regexes is still something that I need to do on a daily basis, when I
> get data from other scientists in odd formats and I need to
> preprocess them. I know people who use a spreadsheet and copy/paste
> millions of datapoints manually becasue they lack the knowledge of
> using such tools.

I think in many cases those most hostile to regexes are the also
those who use them (or need to use them) the least. While my use
of regexes are limited to fairly simple ones they are complicated
enough that I'm sure it would take orders of magnitude longer
to get the same effect in python.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Regular expressions

2015-11-06 Thread rurpy--- via Python-list
On Thursday, November 5, 2015 at 8:12:22 AM UTC-7, Seymore4Head wrote:
> On Thu, 05 Nov 2015 11:54:20 +1100, Steven D'Aprano  
> wrote:
> >On Thu, 5 Nov 2015 10:02 am, Seymore4Head wrote:
> >> So far the only use I have for regex is to replace slicing, but I
> >> think it is an improvement.
> >
> >I don't understand this. This is like saying "so far the only use I have for
> >a sandwich press is to replace my coffee pot". Regular expressions and
> >slicing do very different things.
> >[...]
> 
> Here is an example of the text we are slicing apart.
> 
>[...email headers...]
>
> The practice problems are something like pull out all the email
> addresses or pull out the days of the week and give the most common.

Yes, that is a perfectly appropriate use of regexes.

As Steven mentioned though, the term "slicing" is also used with a 
very specific and different meaning in Python, specifically referring
to a part of a list using a syntax like "alist[a:b]".  I can't seem
to get to python.org at the moment but if you look in the Python
docs index under "slicing" you'll find more info.
 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: FYI: Removing posts with All Cap Authors

2017-03-04 Thread rurpy--- via Python-list
On Saturday, March 4, 2017 at 9:37:35 AM UTC-7, Wanderer wrote:
> On Saturday, March 4, 2017 at 11:31:13 AM UTC-5, Chris Angelico wrote:
> > On Sun, Mar 5, 2017 at 3:22 AM, Wanderer wrote:
> > > I mostly just lurk and view the post titles to see if something 
> > > interesting is being discussed. This code gets me a web page without the 
> > > spam. You need to compile it to a pyc file and create a bookmark. 
> > > Probably not useful for most people who don't use their browsers the way 
> > > I do, but here it is.
> > >
> > > # remove authors with mostly caps
> > >
> > > USERAGENTBASE = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:40.0) 
> > > Gecko/20100101 '
> > > BROWSERPATH = 'C:\\"Program Files"\\Waterfox\\waterfox.exe'
> > > FILENAME = 'C:\\PyStuff\\pygroup.htm'
> > > WEBPAGE = 
> > > "https://groups.google.com/forum/?_escaped_fragment_=forum/comp.lang.python";
> > >
> > 
> > Interesting. Any particular reason to screen-scrape Google Groups
> > rather than start with the netnews protocol? You can get a
> > machine-readable version of the newsgroup much more simply that way, I
> > would have thought.
> > 
> > ChrisA
> 
> I don't know what a netnews protocol is. I use Google Groups to look at 
> usenet.

As a lot of us do.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and the need for speed

2017-04-14 Thread rurpy--- via Python-list
On 04/13/2017 08:13 PM, Steve D'Aprano wrote:
> On Wed, 12 Apr 2017 07:56 pm, bart4...@gmail.com wrote:
> [...]
>> (** Although I find code full of class definitions, one-liners, decorators
>> and all the other esoterics, incomprehensive. I'm sure I'm not the only
>> one, so perhaps readability isn't too much of a priority either.)
> 
> [...] You sound like an old man who
> complains about this new-fangled "telephone", and how things were so much
> better when we had messenger boys to deliver messages anywhere in the city.

This is the second time in two weeks that I have seen an offensive
stereotype presented in this list.  Last time it was "ugly americans".

For those (who've been living under a rock) that are unaware, the 
stereotype of the "old person" who can't understand or adapt to new 
technology is a very vile one that many believe is in large part 
responsible for the high unemployment rate of over-50's in the US, 
along with their positions near the tops of lay-off lists.  This 
form of bigotry is called "ageism".  

There are plenty of ways to use the english language to make your 
point (that people often prefer that which they're familiar with) 
without employing hateful stereotypes directed at a specific groups
of people.

Given that this is the second time in two weeks, I publicly ask the
list moderators to invoke whatever procedures they use to deal with 
bigotry on this list.
-- 
https://mail.python.org/mailman/listinfo/python-list


Bigotry and hate speech on the python mailing list

2017-04-17 Thread Rurpy via Python-list
A couple weeks ago a frequent poster here (Steve D'Aprano 
) called another participant an "ugly american" 
[*1].  This was followed just a couple weeks later with another post from Mr. 
D'Aprano attacking a participant as "an old man" who can't understand new 
technology, a blatant example of ageism [*2].

The PSF's Diversity statement [*3] explicitly calls out "age" and "national 
origin" as examples of personal attributes NOT to be used as verbal weapons.  
It is also neither "considerate" or "respectful" as described in the PSF Code 
of Conduct [*4] to use national origin or age to attack someone.  In both cases 
it is reasonable to believe that some Americans or older people will, after 
reading Mr. D'Aprano's posts, feel uncomfortable posting to this list or 
responding to Mr. D'Aprano specifically on other issues, because they might 
well be attacked on the same grounds.  Further, failure to censure Mr. 
D'Apano's comments communicates that bigotry is acceptable here which 
understandably would give pause to members of other groups often subject to 
bigotry.

I posted a message in objection [*5] that got no response, I would like to 
think because it got lost in a long thread, not because bigotry is acceptable 
here and the CoC is just window dressing.

I also believe the PSF is registered in the US as a tax exempt organization 
which means it has a legal obligation not to permit discrimination against 
people based on national origin or age (and other distinctions).

Would someone from the PSF please publicly clarify exactly why the two cases 
cited are being treated as acceptable discourse in this list?

I am not trying to create a controversy for its own sake; when I first started 
reading this list many years ago I was appalled by rudeness displayed to 
newcomers coupled with instant anger by the regulars towards non-regulars at 
the slightest hint of rudeness (even imagined) towards them.  A decade later 
things have not changed much.  If I posted a remark about "dirty Chinese" (c.f. 
"ugly American") I would be (justifiably) slammed and likely ejected from the 
list.  Or if claims that not understanding new tech is a product of age are ok, 
then why can't I say disparagingly that someone "programs like a girl"?  When a 
popular poster here says such things, it is not only given a pass, it is 
actually defended!  

I am not personally in favor of censorship; the best response to hate speech is 
a reasoned counter argument IMO.  But if you are going to have a CoC, it must 
be applied even-handedly.  You cannot apply it when you want to unpopular 
posters and ignore it when it comes to a one of the clique of regulars.


[*1] https://mail.python.org/pipermail/python-list/2017-April/720531.html
[*2] https://mail.python.org/pipermail/python-list/2017-April/721106.html
[*3] https://www.python.org/community/diversity/
[*4] https://www.python.org/psf/codeofconduct/
[*5] https://mail.python.org/pipermail/python-list/2017-April/721135.html
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Rurpy via Python-list
On 04/17/2017 04:38 AM, Ben Finney wrote:
> Rurpy via Python-list  writes:
> 
>> A couple weeks ago a frequent poster here (Steve D'Aprano
>> ) called another participant an "ugly
>> american" [*1].
> 
> He gave no explicit reference, and so I can see why you would think he
> did what you describe.
> 
> In fact, though, Steven in the message you link to stated:
> 
> If you think that all these people, and hundreds of millions more,
> will just "quietly change the filename" to ASCII because you're too
> lazy, self-centred and arrogant to move on from 1963, then you truly
> are an example of the Ugly American.
> 
> Again, it's not stated explicitly what Steven is referring to, so I can
> see why you would initially be confused.

There is no confusion on my part.  I don't like SJ discussions in technical 
newsgroups any more than you or anyone else here.  I read the relevant posts 
multiple times and thought long and carefully before deciding a response was 
necessary.

> But by now, with plenty of time to look into what was actually being
> discussed, surely you have noticed that Steven was *not* using physical
> appearance as an insult; nor was he using mere national origin as an
> insult.
> 
> Rather, the message is a reference to the Ugly American. Note the
> capitals Steven used; that is how a title is spelled.
> 
> The title “Ugly American” is a reference to a stereotypical *attitude
> and behaviour*, given that name by the 1958 political novel of the same
> name https://en.wikipedia.org/wiki/The_Ugly_American>.

I am and was well aware Mr. D'Aprano's reference was to the book and
derivative stereotype.  I am also aware that book titles are usually 
capitalized.  

(Just as an FYI that you might find useful... I find your response to
be rather condescending in tone.  I have a thick skin and am not easily
offended so no apology necessary but you might want to think about
your communication style sometime.)

> This is not using ugliness, nor American nationality, as an insult. It
> is a reference to objectionable behaviour as Steven described.
>
> Whether you agree that the behaviour described is objectionable, you can
> hopefully agree that naming objectionable behaviour to discourage it, is
> not in itself something to be discouraged.

Both now and in your original apologia for Steven [*1] you fail 
to recognize that there are different ways to point out what one
considers to be objectionable behavior.

Saying that committing crimes is bad, is one thing.  Employing 
the stereotype of African-Americans as criminals and saying that 
one shouldn't act like some black drug-dealing pimp is not. [*2]

> I can fault Steven for assuming that the reader would, by the novel's
> title alone, know of a mid-20th century novel reference or the
> stereotype it describes. That's not a breach of PSF CoC.
> 
> I can fault Steven for assuming that those who *don't* get the reference
> would not leap to the conclusion you've leapt to: that he was using
> national origin as an insult. That assumption on his part is
> unfortunate, and perhaps an apology would be good. Regardless of that,
> it is not a breach of the PSF CoC.

You are focusing here on minor issues, rather like criticizing 
a bank robber for not stopping at a stop sign during his getaway.

And let me repeat what I said above: I leapt to no conclusions; I 
thought carefully before replying.  Your presumption that I am just 
confused because I didn't get his reference is completely off the 
mark.

> What I can't fault him for is using national origin as a verbal weapon.
> He simply did not do that in the message you link to.

He used a stereotype based on national origin to attack someone
whose views he did not agree with.  He subsequently used a different 
stereotype based on age to dispute a view he didn't agree with.
In both cases he could have made his point without dragging in 
millions of other people who he implicitly criticizes on an issue
that is mostly subjective and opinion.

Both are fairly called bigotry as can be demonstrate by transposing 
the statements to other target groups we are more sensitive to
bigotry towards.

Both are in conflict with the PSFs CoC and Diversity statement.
You may nit-pick the words used to describe it, or its importance
but the facts are pretty clear.

>> Further, failure to censure Mr. D'Apano's comments communicates that
>> bigotry is acceptable here which understandably would give pause to
>> members of other groups often subject to bigotry.
> 
> Similarly, my elaboration here – to give it the prominence you rightly
> say that the original sub-thread did not achieve – should demonstrate to
> you that D'Aprano's c

Re: Bigotry and hate speech on the python mailing list

2017-04-17 Thread Rurpy via Python-list
On 04/17/2017 08:19 PM, Wildman via Python-list wrote:
> On Tue, 18 Apr 2017 08:23:34 +1000, Ben Finney wrote:
>> Paul Rubin  writes:
>>> Rurpy  writes:
 A couple weeks ago a frequent poster here (Steve D'Aprano
 ) called another participant an "ugly
 american"
>>>
>>> Oh stop trolling.
>>
>> Paul, that is uncalled for. The charge of bigotry is not to be lightly
>> dismissed, and we do want to foster an environment here where people
>> will feel welcome.
> 
> Your words remind me of this:
> 
> "The seriousness of the charge mandates that we investigate
> this. Even though there is no evidence, the seriousness of
> the charge is what matters."
>   --Tom Foley (D) Speaker of the House

Amusing, like Bill Clinton's "depends what your definition
of is is", or Donald Rumsfeld's known unknowns and unknown 
unknowns.  But yet, isn't investigation what produces evidence?
Sometimes things that sound silly at first really aren't.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bigotry and hate speech on the python mailing list

2017-04-18 Thread Rurpy via Python-list
On 04/18/2017 07:16 AM, Mario R. Osorio wrote:
> Feels like this is something personal against Steven. You should
> probably take this to court. I'd rather read Steven's insightful
> answers and rants than you crying. None here is meant to sugar coat
> anything, and if that is what you are looking for, you don't even
> belong here

On 04/18/2017 03:30 AM, James McMahon wrote:
> Can the moderators please get involved here and remind people to address
> python related topics and questions on the python mailing list? While I can
> only speak to my interest when joining this list, isn't python why
> most people joined this list? Others have different and polarizing views on
> many subjects. This just isn't the right place to voice your views on
> subjects other than python. I delete this same tired thread every day, and
> every day it reappears. With all manners and due respect, stay on topic.
> 
> Isn't this list content moderated by anyone?

I'll reply to you both jointly to minimize the length of this 
thread which I too find unpleasant.

Whether you like it or not this list has a CoC governing it.
Discussions about appropriate posts ARE on-topic.
If you want a list where anyone can say any vile racist thing
they want, there are plenty of them on the internet, you dont
belong here.
I have nothing personal against Steven.  He called someone out
for being bigoted, then repeated the exact same offense himself.
If you want to shorten this thread then dont post inflammatory
remarks that will perpetuate it.
Please trim your replies and dont top post.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bigotry and hate speech on the python mailing list

2017-04-18 Thread Rurpy via Python-list
On 04/18/2017 08:19 AM, Chris Angelico wrote:
> On Wed, Apr 19, 2017 at 12:01 AM, Rurpy via 
> Python-list wrote:
>> I have nothing personal against Steven.  He called someone out
>> for being bigoted, then repeated the exact same offense himself.
> 
> The charge has been examined and dropped. Steven did not violate the
> CoC. Please stop talking as if he has. He *was accused of* violating
> it, and then found innocent.

URL please.  Or is this just a troll?
We're at that point in the thread where the trolls come out
in droves, attracted by the scent of controversy.  Predictable 
as hitting a wasp nest with a stick.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bigotry and hate speech on the python mailing list

2017-04-18 Thread Rurpy via Python-list
On 04/18/2017 09:29 AM, Chris Angelico wrote:
> On Wed, Apr 19, 2017 at 1:03 AM, Rurpy via 
> Python-list wrote:
>> On 04/18/2017 08:19 AM, Chris Angelico wrote:
>>> On Wed, Apr 19, 2017 at 12:01 AM, Rurpy via 
>>> Python-list wrote:
>>>> I have nothing personal against Steven.  He called someone out
>>>> for being bigoted, then repeated the exact same offense himself.
>>>
>>> The charge has been examined and dropped. Steven did not violate the
>>> CoC. Please stop talking as if he has. He *was accused of* violating
>>> it, and then found innocent.
>>
>> URL please.  Or is this just a troll?
>> We're at that point in the thread where the trolls come out
>> in droves, attracted by the scent of controversy.  Predictable
>> as hitting a wasp nest with a stick.
> 
> Earlier in this thread. Go read it.

I've already read every post in this thread since I joined it and nowhere 
has there been anything remotely like your claim.  Again: URL please.

> My next step will be plonking you.

I recommend that.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bigotry and hate speech on the python mailing list

2017-04-18 Thread Rurpy via Python-list
On 04/18/2017 09:35 AM, Wildman via Python-list wrote:
> On Tue, 18 Apr 2017 03:28:32 +, Rurpy wrote:
>> On 04/17/2017 08:19 PM, Wildman via Python-list wrote:
>>> [...]
>>> Your words remind me of this:
>>>
>>> "The seriousness of the charge mandates that we investigate
>>> this. Even though there is no evidence, the seriousness of
>>> the charge is what matters."
>>>   --Tom Foley (D) Speaker of the House
>>
>> Amusing, like Bill Clinton's "depends what your definition
>> of is is", or Donald Rumsfeld's known unknowns and unknown 
>> unknowns.  But yet, isn't investigation what produces evidence?
>> Sometimes things that sound silly at first really aren't.
> 
> Yes, investigation is what produces evidence but "probable
> cause" is needed to begin the investigation.  That means
> there has to be something more than just an accusation.

Your "quote" comes from a joint statement by Tom Foley (D House)
and George Mitchell (D Senate) made in 1991 that actually was: 

 These allegations are both persist and disturbing.  We have
 no *conclusive* evidence of wrongdoing, but the seriousness
 of the allegations, and the *weight of circumstantial information*,
 compel an effort to establish the facts." [*]

To get back to topic, it is interesting how the internet morphs
the quote to match our stereotype of stupid politicians and then
how willing we are to believe it.


[*] 
http://www.nytimes.com/1991/08/06/us/inquiry-is-ordered-on-1980-campaign.html

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bigotry and hate speech on the python mailing list

2017-04-19 Thread Rurpy via Python-list
On 04/18/2017 04:34 PM, Chris Angelico wrote:
> On Wed, Apr 19, 2017 at 8:28 AM, Ben Finney  
> wrote:
>> Chris Angelico  writes:
>>
>>> The charge has been examined and dropped. Steven did not violate the
>>> CoC. Please stop talking as if he has. He *was accused of* violating
>>> it, and then found innocent.
>>
>> Which post are you referring to (can you provide a URL)? I'd like to see
>> who came to that conclusion, what their wording was, and what their
>> authority was to do so.
> 
> I was referring to your post, in which a fairly solid argument was
> made for there being no guilt. Maybe you don't have any specific
> authority, but until someone actually acts in a moderatorial role,
> solid arguments are plenty authoritative enough for most of us.
> Particularly for the newsgroup people, where there is no central
> authority at all.

Perhaps you missed this rebuttal to Mr. Finney's "solid" argument?

  https://mail.python.org/pipermail/python-list/2017-April/721281.html

Perhaps you also failed to notice that neither Mr. Finney nor you 
chose to dispute that rebuttal? 

  Denial: a person is faced with a fact that is too uncomfortable 
  to accept and rejects it instead, insisting that it is not true 
  despite what may be overwhelming evidence. [*2]

Not saying I presented /overwhelming/ evidence but to simply wave it 
away and pretend it doesn't exist?  To simply declare, we prevailed?

Mr, Finney made *one* argument: that comparing someone's behavior 
to the ugly american stereotype is not bigotry because a stereotype
represents only people that exhibit the same deservedly criticizable
behavior.  I showed that was faulty in multiple ways.  In your 
own  words: "go read it."

I get your acceptance of the ugly american stereotype.  After all, 
we all have prejudices (liberals too [*2]) so it's understandable in 
these post-Trump times that we might be blind to our own prejudice 
when it comes to America bashing or closely related Trump bashing,
especially when surrounded by like-minded people.

But when someone attacks a poster's opinion, that some recent 
additions to Python might be a detriment to readability, by 
suggesting he is too old to understand them, with no consideration
of any other explanations?!  

That's no different than disagreeing with someone who says drug 
jail sentences are too long, with: you sound like one of those black 
drug-dealers.  And you both think that's ok?!  I'm aghast.  

Go right ahead and judge yourself and Steven within the CoC.  I 
don't accept that "judgment" any more than I accept former Alabama
Governor George Wallace's defense of segregation.


[*1] https://en.wikipedia.org/wiki/Denial
[*2] 
https://www.psychologicalscience.org/news/releases/politics-and-prejudice-insights-from-psychological-science.html
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bigotry (you win, I give up)

2017-04-19 Thread Rurpy via Python-list

On 04/18/2017 04:34 PM, Chris Angelico wrote:
> On Wed, Apr 19, 2017 at 8:28 AM, Ben Finney  
> wrote:
>> Chris Angelico  writes:
>>
>>> The charge has been examined and dropped. Steven did not violate the
>>> CoC. Please stop talking as if he has. He *was accused of* violating
>>> it, and then found innocent.
>>
>> Which post are you referring to (can you provide a URL)? I'd like to see
>> who came to that conclusion, what their wording was, and what their
>> authority was to do so.
> 
> I was referring to your post, in which a fairly solid argument was
> made for there being no guilt. Maybe you don't have any specific
> authority, but until someone actually acts in a moderatorial role,
> solid arguments are plenty authoritative enough for most of us.
> Particularly for the newsgroup people, where there is no central
> authority at all.

Hey Ben and Chris, 

Forget that last post of mine.  On thinking things over I can see 
now the "judgment" that has been made by your solid arguments and 
the weakness of my counter arguments.  I'm ready to accede to your 
judgment and I hope you bear me no grudge because oue my failure to
see your point immediately.  But I am still a little unclear on a 
couple things which I humbly request you straighten me out on...

Is it only the two stereotypes that were discussed, "ugly americans" 
and "too old to learn" old people that are acceptable?  Or are any 
stereotypes ok?

We all know that Jews stick together and accumulate lots of money.
(Not all of them of course, maybe not even a majority or plurality 
of them, I just mean just the ones that fit the stereotype.) Can 
I use that stereotype?  And obviously not to attack or criticize 
Jews, I would never do that because I am not a bigot.  I mean, use 
it only to point out objectionable behavior like avarice to someone.  
It's now ok if I call him a "greedy Jew", yes?  (And only if he 
is acting/speaking like one!  I know this is not a carte blanche 
to hurl around ethnic slurs.)

Of course there are many, many more stereotypes than just those
so if you could give us an idea how to decide which stereotypes 
are ok and which aren't, I'd really appreciate it.  Maybe you 
could make a list and post it here?

This is only scratching the surface but maybe you could use 
it as a start?
  culturally insensitive americans
  rude french people
  money-hungry jews
  terrorist moslems
  criminal or stupid black people
  unable-to-learn old people
  senile old people
  math, science and programming-inept women
  emotional women
  racist conservatives
  racist misogynist violent Trump supporters
  silly emotion-driven liberals
  rapist immigrants
  weak-willed fat people
  egotistical narcissistic buff people
  japanese people with bad teeth
  backward anti-science catholics
  dirty chinese people

I don't think stupid black people or senile old people should 
be allowable because those are not choosable *behaviors*.  
But is unable-to-learn old people a choosable behavior?  You
said that's ok.  And emotional women, that's a tough one.  
Are they emotional because of choice or hormones?

Also, I'm assuming we can all use stereotypes now but maybe 
that's wrong.  Could it be that only Steven is allowed to use 
them?  Or Steven, Ben, Chris and some other thought-leaders 
of this group?  Or maybe it's only people who have been members 
for a certain length of time or a certain number of posts?  
Again, I'd really appreciate it if you could clarify.

I apologize for all the questions and sorry for sounding like 
a silly emotion-driven liberal before!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bigotry (you win, I give up)

2017-04-19 Thread Rurpy via Python-list
On 04/19/2017 01:56 PM, Ben Finney wrote:
> Rurpy via Python-list  writes:
> 
>> I don't think stupid black people or senile old people should be
>> allowable because those are not choosable *behaviors*. But is
>> unable-to-learn old people a choosable behavior? You said that's ok.
>
> No, I didn't say that's okay, and I'm not aware of Chris saying it.

You and Chris refused to find any fault with the use of the two
stereotypes under discussion one of which was "unable-to-learn 
old people".  You defended a poster's use of those stereotypes.
That is fairly described as "being ok with".

> At this point you've been reading far too much into what isn't there,
> and now you're just flatly stating untruths.

Per above it was not an untruth and you are flatly stating an 
untruth by claiming it was.

>> Again, I'd really appreciate it if you could clarify.
> 
> Bigotry against people for innate traits is not okay.'

That's not clarifying, that's repeating.  I asked some specific
questions that you are not answering, for example, which of the 
stereotypes in the list I gave are you ok with and which are you 
not?

Nor is your criteria a very useful given that for many "traits" 
there is not widespread scientific consensus on whether they are 
innate (genetic?), cultural, or consciously adopted.  
The boundary between cultural and conscious is also very fuzzy.

> Demanding special respect for a class of ideas is not okay.

People are not distinct from their ideas.  People internalize 
ideas and their ideas form part of their identity.  When deeply
held, we tend to call them beliefs rather than ideas.
Thus disrespecting or attacking some ideas is tantamount to 
attacking the person, at least in the person's view if not your's.

This is why you cannot create a forum where no offense is given 
to anyone.  The best you can try to do is try to find some tradeoff
that balances freedom of expression and offense.

Using stereotypes greatly increases the likelihood of offense.
I gave a number of reasons why previously and which I refer you 
back to. [*1]

One particular one I'll reiterate: it doesn't help to say "I 
mean only the bad ones", the stereotype WILL get applied far 
beyond the scope you may intend.  When you say "ugly americans", 
the "americans" part creates an implicit contrast with other 
nationalities and implies that somehow americans are more 
ugly than people of other nationalities.  Yet you have no 
real evidence of that.  There does not even exist a definition 
of uglinesss in a quantitative sense let alone any metrics 
of the number of uglies of any nationality.[*2]  So you 
accuse millions of people of an offense with nothing to 
back it up other than some generalized (and informed by bias) 
feelings it is true.  Given that most americans, like people 
of any other nationality, don't see themselves as ugly, you 
offend a large number of people some of whom will dispute your 
claim.  Do you want that discussion on the Python list?

This is also why I drew the parallel to the African-American 
criminal stereotype which, at least in the US, is widely 
recognized as racist and harmful the entire African-American 
community even though there are some (disputed) statistics 
defenders of the stereotype can resort to.  In your case, you 
don't even have that.
 
Now I'm the one who is starting to repeat things so I will
leave it at that.
 
> Wringing your own impression out of people's words, and then claiming
> that's what they said, is not okay.

We've established above that that did not happen.
 
> I hope that clarifies.

No, sorry.


[*1] https://mail.python.org/pipermail/python-list/2017-April/721281.html
[*2] I am sure there is research that addresses this issue but 
 I doubt there is widespread consensus on its consistency or 
 applicability.  Regardless, research is seldom used validly 
 in the employment of stereotypes and even less so in the
 understanding of the stereotype by the recipients.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bigotry and hate speech on the python mailing list

2017-04-20 Thread Rurpy via Python-list
On 04/17/2017 03:39 AM, Marko Rauhamaa wrote:
>[...]

I meant to respond to this earlier but forgot to.  I'll respond
to the following part now since there seems to be some confusion
about my motives/intent.

> In my experience, the bar for banning participants is pretty high, and
> rightly so. Careless statements, insults or bigotry haven't been enough,
> but repeated, personal harassment of an individual have resulted in
> action.

I agree it should be high.  I did not ask for or expect any banning 
to occur and would oppose any such a proposal.  However, a public
note that use of such stereotypes are offensive and not consistent 
with the PSFs CoC/Diversity statement, a friendly reminder that the 
community frowns of that kind of expression regardless of the status 
of the person who made it, would be help maintain a common standard 
of posting decency.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bigotry (you win, I give up)

2017-04-20 Thread Rurpy via Python-list
On 04/19/2017 08:27 PM, Ben Finney wrote:
> Rurpy via Python-list  writes:
> 
>> You and Chris refused to find any fault with the use of the two
>> stereotypes under discussion one of which was "unable-to-learn old
>> people".
> 
> I expressed absolutely nothing on that topic, so I didn't “refuse to
> find any fault”. To claim “you said that is okay” is a bald untruth, I
> said no such thing.
> 
> You are pointing to *absence of a statement* on a topic and claiming
> that it is a “refusal to find any fault”.

Rereading your post, I agree, you did not say anything at all about
the old-people-cant-learn stereotype.

So I apologize for saying you were ok with that.

> By that logic, you have also “refused to find fault with” my neighbour's
> mistreatment of their child. How horrible of you!

No, not by that logic at all.  Never once did you mention your
neighbor or their child in the thread offering me the opportunity
to comment.  I mentioned both stereotypes in every post I made 
(at least where I mentioned either one explicitly).

> Except, that's not a claim I would make of you. I'll thank you not to do
> the same of others.

Yes, I will try to be more careful in the future.

So at this point, you made a single attempt to claim there was 
no stereotyping based on national origin, a claim I refuted here [*1]
and perhaps more clearly here [*2] neither of which there was a reply to.

And you explicitly acknowledge effectively a "no comment" response 
regarding an offensive a stereotype based on age?  Is that a fair 
statement?

So is it not fair to conclude that bigotry through the use of 
stereotypes in contravention of the CoC/Diversity statement is ok
here at least under some circumstances:

 * When the offender is a frequent or popular participant
 * When the stereotype agrees with a prejudice of most of participants
   here.

I repeat what I said in my first post [*3]:

  "if you are going to have a CoC, it must be applied even-handedly."


[*1] https://mail.python.org/pipermail/python-list/2017-April/721281.html
[*2] https://mail.python.org/pipermail/python-list/2017-April/721388.html
[*3] https://mail.python.org/pipermail/python-list/2017-April/721233.html
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bigotry (you win, I give up)

2017-04-20 Thread Rurpy via Python-list
On 04/20/2017 09:25 AM, Rustom Mody wrote:
>[...]
> No one seems to have noticed who Rurpy is defending : Ranting Rick and Bart.
> Sheesh!
> A rhinocerous would have gossamer skin compared to these 'gentlemen'
> Sheesh² !

You are mistaken.  I am not defending Rick or Bart both of whom I am 
well aware are capable of speaking for themselves.

As I said in my first post, 
  "if you are going to have a CoC, it must be applied even-handedly."

> Also the obligatory Voltaire quote is: “I disapprove of what you say, but I 
> will 
> defend to the death your right to say It”

As I said (not that I am comparing myself to Voltaire)

| This is why you cannot create a forum where no offense is given 
| to anyone.  The best you can try to do is try to find some *tradeoff*
| that *balances* freedom of expression and offense.

If you think the current balance should be changed, fine.

My point is simply that whatever balance is chosen, it should apply
to all participants equally.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bigotry (you win, I give up)

2017-04-20 Thread Rurpy via Python-list
On 04/20/2017 01:46 PM, Ben Finney wrote:
>[...]
> I am not obliged to address every point of every post, and the absence
> of comment on any particular point is not generally to be read as full
> assent.

Certainly anyone is free to choose to ignore bigotry on the list,
because one agrees with it, or does not want to oppose the poster, 
or any other reason; that is a perfectly valid individual decision.

But that does not apply to an entire community.  When members of the 
community en masse react that way, and a few even laud the bigotry,
and still no protest, that is a condemnation of a community's ethics
and pretty indisputable proof the CoC is a tool, to be dragged out 
when convenient to repress unpopular opinion or posters and ignored 
when it interferes with propagating the popular view.

>>   "if you are going to have a CoC, it must be applied even-handedly."
> 
> I agree entirely with that.

Sadly, agreement is meaningless if ignored in practice.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bigotry (you win, I give up)

2017-04-22 Thread Rurpy via Python-list
On 04/22/2017 05:17 AM, Rustom Mody wrote:
> On Friday, April 21, 2017 at 2:38:08 PM UTC+5:30, Antoon Pardon wrote:
>> Op 20-04-17 om 17:25 schreef Rustom Mody:
>>> But more importantly thank you for your polite and consistent pointing out 
>>> to
>>> Ben Finney that his religion-bashing signature lines [many of them] and his 
>>> claims to wish this list be welcoming are way out of sync.
>>
>> I don't know. I think a concept like welcoming is too complex, to draw such
>> simple conclusions. First of all we have to make a choice about the public we
>> want to be welcoming to. I'm rather confident we can agree we don't want to
>> be welcoming to bigots on this list.
>>
>> Then feeling welcome is not a boolean, people can feel welcome to a different
>> degree and there are many factors at work. If people tend to react in a 
>> friendly
>> manner to there co-participants, people generally should feel welcome. A 
>> statment
>> in a signature that isn't addressing anyone personnaly may give rise to some
>> irritation but shouldn't make this list feel unwelcome to someone.
> 
> Generally agree
> [though I wonder how you will decide what constitutes a 'bigot'. Look at the
> suggestion in the very subject of these threads]

As the author of that subject, I'm not sure what point you are
trying to make but let me point out that "bigot" does NOT appear 
in the subject line.  I distinguish between "bigotry", an expression 
of intolerance and prejudice and "bigot", a person who repeatedly 
and knowingly makes bigoted statements.

It also seems to me that "bigot", like "racist", has very little 
intellectual value having been degraded by use to little more than
a stronger more emotive form of "asshole" or "dickhead".

>> Do you think critising any idea in one's signature is enough to conclude that
>> this person doesn't wish this list to be welcoming?

I have to agree Antoon here.
I think there is a distinction between a signature that expresses
an opinion (even an offensive one to some) and the use of prejudice 
and bigotry directly in a message and used to attack a person or 
idea rather than a reasoned refutation of the idea itself.

After all, listening to and understanding (though not necessarily)
agreeing with) opinions that differ from our own is surely something
not to be discouraged?

c.l.p:
  Me: I think python strings should be mutable.
  Someome: That's stupid.  You sound like a typical Rurplandian 
who we know have IQ scores 15 points lower than us.
  [It's true that we have lower IQ scores.]

vs. a sig:
  --
  Because of the stupidity of its people, Rurplandia should not
  be admitted to the UN.

I would find the former offensive and objectionable, the latter
offensive but acceptable.

That being said, there are certainly sigs that are offensive enough
to community standards as to be unacceptable.  But the bar for sigs
should be much higher than for bigotry directed towards a person 
in a discussion. 

And the point of my first post remains: whatever that bar is should 
be applied evenhandedly, with regard to both the poster and to the 
politics expressed.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Syntax error for simple script

2017-06-26 Thread Rurpy via Python-list
On 06/26/2017 09:42 AM, Steve D'Aprano wrote:
> On Tue, 27 Jun 2017 01:16 am, Ben S. wrote:
> 
>> print mm + "/" + dd + "/" +  + " " + hour + ":" + mi + ":" + ss
>> ^
>> SyntaxError: Missing parentheses in call to 'print'
>>
>> Whats wrong?
> 
> Did you read the error message?
> 
> Missing parentheses in call to 'print'
> 
> Is the message not clear enough? The call to print requires parentheses (round
> brackets), like all other functions. 
> 
> print(mm + "/" + dd + "/" +  + " " + hour + ":" + mi + ":" + ss)
> 
> 
> If the error message isn't clear enough, what can we do to make it more clear?

How about:

  In Python 2, 'print' was a statement and did not require
  parenthesis around its argument.  In Python 3 'print' has
  been changed to a function and now, like all functions,
  requires parenthesis around its arguments:
python 2:  print arg1, arg2,...
python 3:  print (arg1, arg2,...)

Did you seriously not understand how someone, reading a tutorial or 
book written for Python 2, might be confused when a specific simple
syntax he/she was explicitly told works, doesn't work?  Not everyone 
new to and starting to explore Python appreciates (?!) the major 
compatibility breaks that occurred between Py2 and Py3.  One would
expect that in such a situation, the new user would certainly question
his/her code rather than something changed in Python.

Or better than changing the message, how about leaving it alone and 
simply responding helpfully rather than snappily and condescending to 
inevitable confusion that surely must have been anticipated when the
Python developers chose to make this change.

It's no wonder that some people (often women) who don't like contention, 
find this list rather hostile.
-- 
https://mail.python.org/mailman/listinfo/python-list