Type hinting of Python is just a toy ?

2019-01-04 Thread iamybj--- via Python-list
I read that pep 484 type hinting of python has no effect of performance, then 
what’s the purpose of it? Just a toy ?

Python is an old programming language, but not better than other programming 
languages, then what are you all dong for so many times ? 

Pep484 is too complex. Typle should not a seperate type, in fact it should be 
just a class. Like this in other programming language
Python: Tuple(id: int, name: string, age: int)
Other: class someClass {
public int id;
public string name;
public int age;
}

Design of OOP of python is too bad, so it treat Tuple as a seperate type.

Why looks different than others? afraid of cannot been watched by others?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Type hinting of Python is just a toy ?

2019-01-04 Thread Chris Angelico
On Fri, Jan 4, 2019 at 7:06 PM iamybj--- via Python-list
 wrote:
>
> I read that pep 484 type hinting of python has no effect of performance, then 
> what’s the purpose of it? Just a toy ?

Yep, it's just a toy. There's absolutely no reference anywhere in the
PEP to "rationale and goals", or any mention of use-cases, or anything
like that. The Python core devs just felt like making the language
more complicated for no reason. It definitely doesn't have anything to
do with making it easier to find bugs, or giving IDEs and linters more
tools to work with.

> Python is an old programming language, but not better than other programming 
> languages, then what are you all dong for so many times ?

Old by what definition? Most good programming languages have been
around since the 1990s or earlier. Some date back to the 70s. Fortran
has its origins in the 50s.

> Pep484 is too complex. Typle should not a seperate type, in fact it should be 
> just a class. Like this in other programming language
> Python: Tuple(id: int, name: string, age: int)
> Other: class someClass {
> public int id;
> public string name;
> public int age;
> }

In other words, you want typing to be as restrictive as it is in C++
or Java. How would you define the type "JSON-encodable"? You can
encode a string, an integer, a float, an array of JSON-encodable
objects, and a mapping from strings to JSON-encodable objects. Can you
represent that as a class?

> Design of OOP of python is too bad, so it treat Tuple as a seperate type.
>
> Why looks different than others? afraid of cannot been watched by others?

And this is the bit where I go, yep, troll, bye bye.

Except for the part where I delete your message without bothering to
reply, which is probably a mistake on my part.

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


Re: Type hinting of Python is just a toy ?

2019-01-04 Thread Ian Kelly
On Fri, Jan 4, 2019 at 1:20 AM Chris Angelico  wrote:
> > Pep484 is too complex. Typle should not a seperate type, in fact it should 
> > be just a class. Like this in other programming language
> > Python: Tuple(id: int, name: string, age: int)
> > Other: class someClass {
> > public int id;
> > public string name;
> > public int age;
> > }
>
> In other words, you want typing to be as restrictive as it is in C++
> or Java. How would you define the type "JSON-encodable"? You can
> encode a string, an integer, a float, an array of JSON-encodable
> objects, and a mapping from strings to JSON-encodable objects. Can you
> represent that as a class?

I'm not sure the OP is saying that at all. It kind of sounds like he
thinks that tuples are Python's version of classes, which is pretty
hilarious.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Type hinting of Python is just a toy ?

2019-01-04 Thread Chris Angelico
On Fri, Jan 4, 2019 at 7:54 PM Ian Kelly  wrote:
>
> On Fri, Jan 4, 2019 at 1:20 AM Chris Angelico  wrote:
> > > Pep484 is too complex. Typle should not a seperate type, in fact it 
> > > should be just a class. Like this in other programming language
> > > Python: Tuple(id: int, name: string, age: int)
> > > Other: class someClass {
> > > public int id;
> > > public string name;
> > > public int age;
> > > }
> >
> > In other words, you want typing to be as restrictive as it is in C++
> > or Java. How would you define the type "JSON-encodable"? You can
> > encode a string, an integer, a float, an array of JSON-encodable
> > objects, and a mapping from strings to JSON-encodable objects. Can you
> > represent that as a class?
>
> I'm not sure the OP is saying that at all. It kind of sounds like he
> thinks that tuples are Python's version of classes, which is pretty
> hilarious.

O. And here I thought that *closures* were Python's version of C++
classes. My bad.

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


Re: Type hinting of Python is just a toy ?

2019-01-04 Thread iamybj--- via Python-list
In fact, there is only 3 types in all prigramming languages.
Primitive type: int, string, bool, char
Complex type: struct or class
Array Type: int[10], string[100], struct[1000]

These 3 type can represent all thins in the world.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the python name

2019-01-04 Thread Peter J. Holzer
On 2019-01-04 02:04:14 -0500, songbird wrote:
> Rick Johnson wrote:
> > songbird wrote:
> >
> ...
> >> if you want to know the perspective of a new person 
> >> to the language and to help out make it better i have
> >> a few suggestions for where to spend your time in a
> >> way that will help out people a great deal.
> >
> > I'm listening...
> 
>   i only get so many units of time to work on something.
> the more rabbit holes i need to go down to figure out
> a basic issue the less likely progress actually happens.
> 
>   setting
> up your package to install to the right location(s).
[...]
>   platform, os, sys, pathlib, distro (looks like they need
> help).
> 
>   a test of any change to the setup involves an upload
> which may take a half hour or more to show up, by then
> i can be interrupted and not get back to it for days.
[...]
>   finding out all the caches and how to verify they are 
> either in sync or if you should clear them and how.
[...]
>   i do have testers for Mac and Windows that can give me 
> feedback,
[...]

Almost all of these points don't seem to be related to the language, but
to your environment.

>   there must be a more local way to do the same thing but 

I do some of my Python development locally and and some remotely, but
that's mostly because to me it doesn't make much difference (vim in a
terminal works the same when I'm ssh'd into a server as when I work
locally) and not having to replicate the environment is a plus for me.
If my tools worked only locally, I could do all development locally.

> as of yet the develop option doesn't seem to work how i
> would expect.

What is "the develop option"? Again, it seems like you are talking about
a specific environment, not Python the language.

hp

-- 
   _  | Peter J. Holzer| we build much bigger, better disasters now
|_|_) || because we have much more sophisticated
| |   | h...@hjp.at | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson 


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-04 Thread marco . nawijn
On Thursday, January 3, 2019 at 9:40:43 PM UTC+1, Chris Angelico wrote:
> On Fri, Jan 4, 2019 at 7:37 AM Mohan Mohta  wrote:
> > I am no expert in python but I found grep is lot faster in than the methods 
> > of reading files from python point me to direction if you know of 
> > anything faster I would appreciate it.
> >
> 
> Try doing things the simple and easy way in Python, then figure out if
> it's too slow. Only THEN should you worry about "faster".
> 
> ChrisA

Yeah, and once you find out you need to go faster and subsequently start 
looking into ways you *can* go faster, you finally end up with code similar to 
what is implemented in the grep family of tools.

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


Re: Type hinting of Python is just a toy ?

2019-01-04 Thread Chris Angelico
On Fri, Jan 4, 2019 at 8:06 PM iamybj--- via Python-list
 wrote:
>
> In fact, there is only 3 types in all prigramming languages.
> Primitive type: int, string, bool, char
> Complex type: struct or class
> Array Type: int[10], string[100], struct[1000]
>
> These 3 type can represent all thins in the world.

Why do you need three types? REXX has just one type: the string.
Structures, classes, arrays, mappings, etc are all implemented with a
special type of variable, the "stem".

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


Re: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-04 Thread Chris Angelico
On Fri, Jan 4, 2019 at 10:16 PM  wrote:
>
> On Thursday, January 3, 2019 at 9:40:43 PM UTC+1, Chris Angelico wrote:
> > On Fri, Jan 4, 2019 at 7:37 AM Mohan Mohta  wrote:
> > > I am no expert in python but I found grep is lot faster in than the 
> > > methods of reading files from python point me to direction if you 
> > > know of anything faster I would appreciate it.
> > >
> >
> > Try doing things the simple and easy way in Python, then figure out if
> > it's too slow. Only THEN should you worry about "faster".
> >
> > ChrisA
>
> Yeah, and once you find out you need to go faster and subsequently start 
> looking into ways you *can* go faster, you finally end up with code similar 
> to what is implemented in the grep family of tools.
>

Maybe... but most likely not using a subprocess. But it's still
premature to worry about performance when you don't have any evidence
that your code is too slow.

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


Re: Type hinting of Python is just a toy ?

2019-01-04 Thread Joel Goldstick
On Fri, Jan 4, 2019 at 7:50 AM Chris Angelico  wrote:
>
> On Fri, Jan 4, 2019 at 8:06 PM iamybj--- via Python-list
>  wrote:
> >
> > In fact, there is only 3 types in all prigramming languages.
> > Primitive type: int, string, bool, char
> > Complex type: struct or class
> > Array Type: int[10], string[100], struct[1000]
> >
> > These 3 type can represent all thins in the world.
>
> Why do you need three types? REXX has just one type: the string.
> Structures, classes, arrays, mappings, etc are all implemented with a
> special type of variable, the "stem".
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list

I don't normally comment on this type of thread, but I believe the OP
is showing an example of the dunning-kruger effect
https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect

Not teasing, really.

-- 
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: subprocess : AttributeError: 'Popen' object has no attribute 'read'

2019-01-04 Thread Peter Otten
Mohan Mohta wrote:

> Hello,
> I am trying to grep the keyword (which I got from report_file ) from
> report_file
> 
> I tried multiple ways but am unable to get it to work.
> 
> Below are the methods I tried.
> 
> 
> fp=open(txt_file,'r')
>  for line in fp :
> line=line.strip()
> var1=line.lower()
> g_info=subprocess.Popen('cat report_file| grep -i '+var1,
> stdout=subprocess.PIPE,stderr=subprocess.PIPE,shell=True)
> g_info=g_info.read() g_info=g_info.strip()
> info=g_info.strip('||')
> print g_info
> print info
> fp.close()

> Error:
> AttributeError: 'Popen' object has no attribute 'read'

You have to specify the stream/file, e. g. 

g_info.stdout.read() 

but when want both stdout and stderr your reading attempts may produce a 
deadlock as the fine manual warns.

So with basic error checks:

import subprocess

def grep(file, wanted):
p = subprocess.Popen(
["grep", "-i", wanted, file],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
stdout, stderr = p.communicate()
if p.returncode:
raise Exception(stderr)
return stdout


txt_file = "wanted.txt"
report_file = "report.txt"

with open(txt_file) as fp:
for line in fp :
wanted = line.strip().lower()
print "Looking for:", wanted
print "Found:"
print grep(report_file, wanted)

> info=g_info.strip('||')

This does not do what you think it does -- it will remove all "|" chars from 
the beginning and the end of the string, just like g_info.strip("|") and 
g_info.strip("") would, i. e. the str.strip() argument is 
treated like a set of chars.

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


Re: Type hinting of Python is just a toy ?

2019-01-04 Thread Abdur-Rahmaan Janhangeer
it will have it's uses ... for people who want to make some hacks like ...
source-to-source compilers

Abdur-Rahmaan Janhangeer
http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ
Mauritius
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the python name

2019-01-04 Thread William Ray Wing via Python-list
On 3/01/19 2:03 PM, Avi Gross wrote:
> Challenge: Can we name any computer language whose name really would suggest 
> it was a computer language?
> I think the name is the least important aspect of a computer language.

I’d like to propose that classic FORTRAN (FORmulaTRANslator) came/comes close.

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


Re: Type hinting of Python is just a toy ?

2019-01-04 Thread Terry Reedy

On 1/4/2019 4:04 AM, iamybj--- via Python-list wrote:

In fact, there is only 3 types in all prigramming languages.


'Category' would be a better term.  Better said might be: "One can 
usefully group types/classes of values/objects into 3 categories."



Primitive type: int, string, bool, char
Complex type: struct or class
Array Type: int[10], string[100], struct[1000]


And tuples are an array class, in particular an immutable and and 
therefore hashable array, and therefore possible members of sets and 
dict keys.


--
Terry Jan Reedy

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


RE: the python name

2019-01-04 Thread Avi Gross
William,

Although I used FORTRAN ages ago and it still seems to be in active use, I am 
not clear on why the name FORMULA TRANSLATOR was chosen. I do agree it does 
sound more like a computer language based on both the sound and feel of FORTRAN 
as well as the expanded version.

It seems to have been designed as a mathematical extension of sorts that 
allowed you to evaluate a mathematical formula efficiently. I mean things like 
quadratic equations. But there is overlap with what other languages like COBOL 
or BASIC did at the time.

What gets me is the vagueness of the words looked at by ME today. Any modern 
computing language can do what standard FORTRAN does, albeit perhaps more 
slowly as I know some languages do some of their math using libraries from 
FORTRAN. But do we use the word TRANSLATOR quite that way much anymore? Heck, 
do we use FORMULA in the same way?

My most recent use of formula has been in the R language where there is a 
distinct object type called a formula that can be used to specify models when 
doing things like a regression on data. I am more likely to call the other kind 
using words like "equation". Python has an add-on that does symbolic 
manipulation. Did FORTRAN have any of these enhanced objects back when created, 
or even now?

As I joked in an earlier message, I remember using a version of FORTRAN called 
WATFOR. Yes, there was a WATFIV. 



-Original Message-
From: Python-list  On 
Behalf Of William Ray Wing via Python-list
Sent: Friday, January 4, 2019 11:06 AM
To: Python 
Cc: William R. Wing 
Subject: Re: the python name

On 3/01/19 2:03 PM, Avi Gross wrote:
> Challenge: Can we name any computer language whose name really would suggest 
> it was a computer language?
> I think the name is the least important aspect of a computer language.

I’d like to propose that classic FORTRAN (FORmulaTRANslator) came/comes close.

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

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


Re: Type hinting of Python is just a toy ?

2019-01-04 Thread lorenzo . gatti
On Friday, January 4, 2019 at 9:05:11 AM UTC+1, iam...@icloud.com wrote:
> I read that pep 484 type hinting of python has no effect of performance, then 
> what’s the purpose of it? Just a toy ?
Having no effect on performance is a good thing; Python is already slowish, 
additional runtime type checking would be a problem. 
The purpose of type hinting is helping tools, for example ones that look for 
type errors in source code (e.g. a function parameter is supposed to be a 
string, but an integer is being passed).
> 
> Python is an old programming language, but not better than other programming 
> languages, then what are you all dong for so many times ? 
Being nice in general, and not too aggressive with trolls in particular, is 
also a good thing.
> 
> Pep484 is too complex. Typle should not a seperate type, in fact it should be 
> just a class. Like this in other programming language
> Python: Tuple(id: int, name: string, age: int)
> Other: class someClass {
>   public int id;
>   public string name;
>   public int age;
> }
But tuple (not Tuple) is already is a class. Are you missing the difference 
between declaring a type and invoking a constructor? Try to work out complete 
examples.
> Design of OOP of python is too bad, so it treat Tuple as a seperate type.
If you mean that defining classes could be replaced by uniformly using tuples, 
it is not the case because classes can have a lot of significant behaviour, 
including encapsulation.
If you mean that the specific tuple class shouldn't exist and all classes 
should be in some way like tuple, it is not the case because many classes have 
to behave differently and above that tuple has special syntax support. It's 
about as special as the dict class and the list class, and clearly different.
> Why looks different than others? afraid of cannot been watched by others?
Like most programming languages, Python was deliberately designed to be 
different from existing programming languages in order to make an experiment 
(which could be summarized as interpreted, with a lot of convenient syntax in 
order to be brief and readable, strictly object oriented, strongly but 
dynamically typed) and to gain adoption (by offering an advantage to users who 
wouldn't bother trying a language that is only marginally different from 
existing ones). 
By all means, use other programming languages if you think they are better, but 
don't expect Python to change in radical ways.

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


How to get rid of 3.7.2 (32-bit) in favour of 3.7.2 (64-bit)

2019-01-04 Thread Mathias Feiler

Hello,
I'm as new to this mailinglist as I'm to Win10 (actually les than 24 
hour). Just installed both on my new Thinkpad.

Well,  accidently  I also just installed  Python 3.7.2 (32-bit).
Now  I have trouble to get rid of it (in favour of the 64-bit version).
I tried to "uninstall the App"  more6 times now by
Window ::
?settings? ::
Apps ::
Select  "Python 3.7.2 (32-bit)"
Klick Uninstall
...
Admin-Password
...

The "Python 3.7.2 (32-bit) Setup" sayes "Uninstall was successful"
An hint me to this mailinglist if I encounter problems.

Well, here I am.

Thus my Question are:
Does I try to uninstall the wrong way (New to Windows)?
Does the Package got some pitfalls stiking back?
What can I do to get rid of the "wrong" package?

Thank You for Your Answer in ahead.

Sincerely

Mat







--
Mathias Feiler - Universität Hohenheim
Stabsstelle für Datenschutz
Raum 04.35/-150 Schloss, äußerer Osthof-Süd
Schwerzstraße 46 | 70599 Stuttgart
Tel. +49 711 459 23949 | Fax +49 711 459 22432

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


Re: the python name

2019-01-04 Thread Gene Heskett
On Thursday 03 January 2019 15:28:49 Grant Edwards wrote:

> On 2019-01-03, Gene Heskett  wrote:
> > Do I miss-remember that there was an anaconda language at sometime
> > in the past? Not long after python made its debute? I've not see it
> > mentioned in a decade so maybe its died?
>
> About 20 years ago, the RedHat Linux (way before RHEL) installer
> (which was written in Python) was called Anaconda.
>
> --
> Grant Edwards   grant.b.edwardsYow! What UNIVERSE
> is this, at   please??
>   gmail.com

Thanks for rescuing my old wet ram Grant, thats exactly what I was 
thinking of. AIR, it wasn't anywhere near a "real installer" and I spent 
a decent amount of time turning perfectly good air blue. 

Have a fine 2019 Grant, and thanks again.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What can python replace?

2019-01-04 Thread songbird
Avi Gross wrote:
...

  this is really a computation theory question and for the
most part you'll find that all languages of suitable power
can replace each other.

  arguably some languages seem more expressive or easier 
to read than others.

  but the most popular languages will often have translators
for other languages as a part of their larger ecosystem.


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


Re: Type hinting of Python is just a toy ?

2019-01-04 Thread iamybj--- via Python-list
{ id: 1, name:’abc’, age:99, address:{province:’CA’, city:’SA’}}

Can be represent by:

Class Address {
public string province;
public string city;
}

Class Person {
public int id;
public string name;
public int age;
public Address address;
}
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the python name

2019-01-04 Thread Peter J. Holzer
On 2019-01-04 11:34:24 -0500, Avi Gross wrote:
> Although I used FORTRAN ages ago and it still seems to be in active
> use, I am not clear on why the name FORMULA TRANSLATOR was chosen.

Keep in mind that FORTRAN was one of the very first languages which
didn't have a 1:1 mapping to machine code. A programmer could actually
write a formula (instead of a sequence of machine instructions), and the
compiler would translate it into machine code.

So I guess "formula translator" was an apt description of what was seen
as the main benefit over earlier systems.

> I do agree it does sound more like a computer language based on both
> the sound and feel of FORTRAN as well as the expanded version.

FORTRAN is older than most of us. So it influenced what we think a
computer language should sound like.


> It seems to have been designed as a mathematical extension of sorts
> that allowed you to evaluate a mathematical formula efficiently. I
> mean things like quadratic equations. But there is overlap with what
> other languages like COBOL or BASIC did at the time.

Both COBOL and BASIC were invented after FORTRAN. And I'm not sure
whether COBOL's COMPUTE statement was in the language from the beginning
or a later addition.

> 
> What gets me is the vagueness of the words looked at by ME today. Any
> modern computing language can do what standard FORTRAN does,

The shoulders of giants and all that.


> albeit perhaps more slowly as I know some languages do some of their
> math using libraries from FORTRAN. But do we use the word TRANSLATOR
> quite that way much anymore?

No. Today we use the word "compiler". Jargon has evolved.

> Heck, do we use FORMULA in the same way?

Probably yes, but we don't think automatically translating formulas into
machine code is in any way remarkable any more. After all, that problem
was solved 60+ years ago. Today's buzzword is "algorithm" (usually used
incorrectly by the media).

> My most recent use of formula has been in the R language where there
> is a distinct object type called a formula that can be used to specify
> models when doing things like a regression on data. I am more likely
> to call the other kind using words like "equation". Python has an
> add-on that does symbolic manipulation. Did FORTRAN have any of these
> enhanced objects back when created, or even now?

Certainly not then. Probably not now. Fortran isn't about symbolic
manipulation. It's about number crunching. And in the beginning it was
mostly about not having to write assembler.

hp

-- 
   _  | Peter J. Holzer| we build much bigger, better disasters now
|_|_) || because we have much more sophisticated
| |   | h...@hjp.at | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson 


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Type hinting of Python is just a toy ?

2019-01-04 Thread Chris Angelico
On Sat, Jan 5, 2019 at 4:43 AM iamybj--- via Python-list
 wrote:
>
> { id: 1, name:’abc’, age:99, address:{province:’CA’, city:’SA’}}
>
> Can be represent by:
>
> Class Address {
> public string province;
> public string city;
> }
>
> Class Person {
> public int id;
> public string name;
> public int age;
> public Address address;
> }

http://wiki.c2.com/?BlubParadox

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


Re: Type hinting of Python is just a toy ?

2019-01-04 Thread Ian Kelly
On Fri, Jan 4, 2019 at 10:44 AM iamybj--- via Python-list
 wrote:
>
> { id: 1, name:’abc’, age:99, address:{province:’CA’, city:’SA’}}

Those are nested dicts, not tuples, which leaves your argument really unclear.

A dict is essentially a hash map. Java and C# (it's unclear what
language you're comparing to, but it looks like one of those) also
have hash maps. So why are you complaining that Python has hash maps
by comparing it to a language that also has hash maps?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the python name

2019-01-04 Thread Ian Kelly
On Fri, Jan 4, 2019 at 10:59 AM Dennis Lee Bieber  wrote:
>
> On Fri, 4 Jan 2019 01:12:42 -0500, "Avi Gross" 
> declaimed the following:
>
>
> >language, Formula Translator? (I recall using the What For version).
>
> WATFOR => WATerloo FORtran

And then there was WATFIV, which stands for WATerloo Fortran IV.
Because 5 == IV.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the python name

2019-01-04 Thread William Ray Wing via Python-list

> On Jan 4, 2019, at 11:34 AM, Avi Gross  wrote:
> 
> 

[BYTE]

> As I joked in an earlier message, I remember using a version of FORTRAN 
> called WATFOR. Yes, there was a WATFIV. 
> 
> 

Yah - WATFOR was Waterloo FORTRAN, an interpreted FORTRAN that was used a lot 
in intro classes.  No matter what the student did (negative indexes in early 
FORTRAN would get you down into the OS), under WATFOR the mainframe (yup) 
wouldn’t crash.

Bill

PS:  I, for one will drop this now as it is getting further off topic.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: conda/anaconda and pip3 (pip)

2019-01-04 Thread Paulo da Silva
Às 19:54 de 09/12/18, Tim Williams escreveu:
> On Saturday, December 8, 2018 at 10:13:14 PM UTC-5, Monte Milanuk wrote:
>> Did you find any solution(s)?
> 
> I usually just lurk and read on this list. I don't reply since there's 
> usually more competent people that regularly post helpful answers. (I lurk to 
> learn from them!)
> 
> If no one's replied yet, I'll give it my 2 cents ...
> 
> Without being a pip expert, I see from 'pip install -h' that you can specify 
> where you want the package to be installed.
> 
> Install Options:
...

>   path or a VCS url.
>   -t, --target   Install packages into . By default this 
> will not replace existing files/folders in
>   . Use --upgrade to replace existing 
> packages in  with new versions.
...

> 
> I'm thinking the the --target option may be the solution.
> 

I don't think this is a solution.
It seems that there is no really solutions at all.
(ana)conda has its own dependencies management. Playing with pip just
seems to cause dependencies problems, eventually.
So far, I have not found any problems, probably because the newer
modules are backwards compatible.

Thanks for responding.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the python name

2019-01-04 Thread songbird
Peter J. Holzer wrote:
> songbird wrote:

hi,

  thank you for your reply.


...
> Almost all of these points don't seem to be related to the language, but
> to your environment.

  an application isn't useful unless it actually can
be deployed and used in an environment.

  the easier it is for me to stay within the language
itself using whatever modules and features it provides.
and more the the better because every time i have to 
go outside to investigate or debug other things that 
adds complexity and more points of failure and more 
issues that get in the way of me actually working on 
the program (it also interferes with my goals if i'm
having to deal with beaurocracy issues instead of
fixing bugs or learning Python better).


  at least these make sense:

  https://packaging.python.org/tutorials/installing-packages/
  https://docs.python.org/3/installing/index.html#installing-index

  and this helps answer a lot of my questions that have been
hovering around:
  https://pip.pypa.io/en/stable/reference/pip_install/#caching


>>   there must be a more local way to do the same thing but=20
>
> I do some of my Python development locally and and some remotely, but
> that's mostly because to me it doesn't make much difference (vim in a
> terminal works the same when I'm ssh'd into a server as when I work
> locally) and not having to replicate the environment is a plus for me.
> If my tools worked only locally, I could do all development locally.

  i'm always working on my local machine first and 
foremost.  i always need a quick method for testing 
the whole chain from code to install and running tests
that doesn't involve a large turn around in time.

  as an example, the program hugo which lets me
generate a static web site.  it is great that i can 
do all of my local development and testing without 
having to upload it to the web server and then 
when i finally do upload it and test it out it 
almost always works the same way and there isn't
a half hour delay between me finding out something
didn't work.


>> as of yet the develop option doesn't seem to work how i
>> would expect.
>
> What is "the develop option"? Again, it seems like you are talking about
> a specific environment, not Python the language.

   i hope my comments above are sufficient to get 
my points across about "environment".


  i use this command to put my project into a
local virtual environment:

(env)$ pip3 install -e $NGFP_SRC_HOME/ --no-cache-dir --force-reinstall


where:
-e,--editable 
  Install  a  project  in editable mode (i.e.  setuptools "develop
  mode") from a local project path or a VCS url.

  it doesn't seem to work how i expect, but that could be
my own bug someplace.  haven't tracked it down yet.

  i'm also trying to get back more to what my initial 
goals were with this project (to learn the language 
and to learn OOP concepts better).  when i can get back
to the code itself and whack it into better shape then
i'll feel a lot better.  i admit it is a mess now.


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


Re: conda/anaconda and pip3 (pip)

2019-01-04 Thread Paulo da Silva
Às 19:39 de 02/01/19, Hartmut Goebel escreveu:
> Am 03.12.18 um 18:39 schrieb Paulo da Silva:
>> This also has a bad side effect! It reinstalls there some depedencies
>> already installed in the conda created environment!
>>
>> Is there a way to avoid this situation?
> 
> Try whether  `pyvenv --system-site-packages` suites you.
> 

I need to use conda for this.
I need anaconda because it has all stuff to work with GPUs. Otherwise
I'd need to install lots of SW. One package, for example, requires
registration at Nvidia. It also difficult to determine a common base of
compatible versions.

Thanks for responding.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the python name

2019-01-04 Thread Gene Heskett
On Friday 04 January 2019 13:22:03 Ian Kelly wrote:

> On Fri, Jan 4, 2019 at 10:59 AM Dennis Lee Bieber 
 wrote:
> > On Fri, 4 Jan 2019 01:12:42 -0500, "Avi Gross"
> > 
> >
> > declaimed the following:
> > >language, Formula Translator? (I recall using the What For
> > > version).
> >
> > WATFOR => WATerloo FORtran
>
> And then there was WATFIV, which stands for WATerloo Fortran IV.
> Because 5 == IV.

Not what I was taught 75 years ago. Thats a brand new definition of fuzzy 
logic. :(

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the python name

2019-01-04 Thread Chris Angelico
On Sat, Jan 5, 2019 at 8:31 AM Gene Heskett  wrote:
>
> On Friday 04 January 2019 13:22:03 Ian Kelly wrote:
> > And then there was WATFIV, which stands for WATerloo Fortran IV.
> > Because 5 == IV.
>
> Not what I was taught 75 years ago. Thats a brand new definition of fuzzy
> logic. :(

Maybe it's different if you went to an IV league school?

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


RE: Type hinting of Python is just a toy ?

2019-01-04 Thread Avi Gross
You can play mathematical reduction games and declare the only type of
variable needed is a memory location but who cares?

The reality is that well designed data structure can allow you to think
about a problem in a way that leads to easy solutions. True, you can store
something like an employee record with N fields in an amazing number of
ways. It can be a simple or nested list construct, or an instance of some
class or a dictionary, perhaps nested, or it can be a newly minted object
like a NamedTuple or it can even be stored in N unrelated variables. But
some representations appeal to some people and some perhaps to others and
some depend on the situation. There tends to be room for multiple ways.

Anyone ever use a version of LISP where the dominant or even only data
structure was nested lists. I shudder at memories of having to use weird
functions like CAADDR which effectively did the equivalent of multiple
instances of CAR and CDR to dig deeply into such a mess. Why would anyone
want to use that representation on a regular basis.

Python thought it had all the primitive data types in the base. What more do
you need than strings, numbers, and several variants on a list? Throw in
dictionaries, and clearly you can write anything? Heck, throw in
classes/objects and you can make anything else?

Well, it seems that over the years people have felt the need to make so much
more and then set it aside for reuse. I use what amounts to a restricted
list all the time. A numpy array forces all entries to be of the same type.
Not necessarily pythonic but when you are used to a language where there is
no simpler data type consisting of a single int or a single character and
everything is of indefinite length so the above is just a vector of length
1, you start wanting that to represent things like columns of data. When you
are used to something that is a 2D representation, you may want something
like a matrix or DataFrame and so on. True, these can be built easily using
1D components in a list along with algorithms on how to calculate where the
nth item will be stored. But to program more the way you think and be able
to ignore lower-level details, more is needed. 

And, in the same vein, you may want to add a layer of logic or restrictions
around those basic types such as requiring them to be non-negative. You may
want to handle a concept like infinity which simply cannot be an aspect in a
truly primitive type.

It takes some Gaul to say all variables can be divided into three parts
(just kidding.)

Of course having too many choices can freeze new learners and old ones
alike. Research on human psychology shows that people in a 401K plan or IRA
(several of many U.S. tax-advantaged plans) that offers too many choices
often results in people making no choice (getting a low interest account by
default perhaps) or putting a small amount I MANY of them since they have no
idea what makes sense and have trouble with decisions.

But any good programming language needs a decent number of choices.
Arguments that a tuple is just a restricted list so why do you need it are
more reductionist than practical. There are quite a few reasons to have both
and repercussions of your choice.



-Original Message-
From: Python-list  On
Behalf Of Joel Goldstick
Sent: Friday, January 4, 2019 9:04 AM
Cc: Python 
Subject: Re: Type hinting of Python is just a toy ?

On Fri, Jan 4, 2019 at 7:50 AM Chris Angelico  wrote:
>
> On Fri, Jan 4, 2019 at 8:06 PM iamybj--- via Python-list 
>  wrote:
> >
> > In fact, there is only 3 types in all prigramming languages.
> > Primitive type: int, string, bool, char
> > Complex type: struct or class
> > Array Type: int[10], string[100], struct[1000]
> >
> > These 3 type can represent all thins in the world.
>
> Why do you need three types? REXX has just one type: the string.
> Structures, classes, arrays, mappings, etc are all implemented with a 
> special type of variable, the "stem".
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list

I don't normally comment on this type of thread, but I believe the OP is
showing an example of the dunning-kruger effect
https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect

Not teasing, really.

--
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays
--
https://mail.python.org/mailman/listinfo/python-list

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


Re: the python name

2019-01-04 Thread songbird
Rick Johnson wrote:
...
> You're singing a sad tune songbird, but i feel your pain...

  like all things, this too shall pass...  :)


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


Re: the python name

2019-01-04 Thread Gene Heskett
On Friday 04 January 2019 16:37:49 Chris Angelico wrote:

> On Sat, Jan 5, 2019 at 8:31 AM Gene Heskett  
wrote:
> > On Friday 04 January 2019 13:22:03 Ian Kelly wrote:
> > > And then there was WATFIV, which stands for WATerloo Fortran IV.
> > > Because 5 == IV.
> >
> > Not what I was taught 75 years ago. Thats a brand new definition of
> > fuzzy logic. :(
>
> Maybe it's different if you went to an IV league school?

Dunno Chris, but I'd swear that was morning glory's blooming on the 
fences surrounding that rural schoolhouse, rubble and mortered walls 
about 3 feet thick, as long as we had coal for the warm morning stove, 
we were fine.  Its sans roof now as it was thatched then, but that 
building still stands with well over 100 years worth of Iowa winters on 
its log now.  Near a ghost town called Pitzer in Madison County IA. 
Yeah, the subject of the Eastwood and Streep movie called The Bridges of 
Madison County. Many of them covered, been over most of them as a 5 year 
old. And I remember the evening of Dec 7th, 1941. Listening to the news 
on a battery radio, and watching my grandfather crying because he knew 
lots of men would give their all before the as yet undeclared war was 
over. There was never any doubt that we would win it, but for the city 
folks, hard times were ahead with the rationing. Lots of fat folks got 
in shape by 1945-46 whether they wanted to or not. Out on a farm, with a 
good team of horses, we were somehat insulated from the hardships of the 
war as we raised our own food. But I remember it well.

>
> ChrisA


Cheers, Gene Heskett
-- 

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


RE: the python name

2019-01-04 Thread Avi Gross
Gene,

It is simple in Python:

if "IV" in "FIVE":
print("Roman 4 is 5!")

prints:

Roman 4 is 5!

Just a stupid coincidence that the spelling in current English for the
numeral Five happens to have the silly one-less than 5 notation of the Roman
numerals IV. 

Maybe someone with my perverted sense of humor found it amusing to change
the nomenclature so WAT remains the same in WATFOR and in WATFIV but they
did not retain the FOR and make WATFORIV which might be harder to pronounce.

Now if they had named the language pithon or python instead of python, we
might be having marathon sessions evaluating digits of pi or eating dessert.

Time to stop posting before ...

-Original Message-
From: Python-list  On
Behalf Of Gene Heskett
Sent: Friday, January 4, 2019 4:20 PM
To: python-list@python.org
Subject: Re: the python name

On Friday 04 January 2019 13:22:03 Ian Kelly wrote:

> On Fri, Jan 4, 2019 at 10:59 AM Dennis Lee Bieber
 wrote:
> > On Fri, 4 Jan 2019 01:12:42 -0500, "Avi Gross"
> > 
> >
> > declaimed the following:
> > >language, Formula Translator? (I recall using the What For  
> > >version).
> >
> > WATFOR => WATerloo FORtran
>
> And then there was WATFIV, which stands for WATerloo Fortran IV.
> Because 5 == IV.

Not what I was taught 75 years ago. Thats a brand new definition of fuzzy
logic. :(

Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
--
https://mail.python.org/mailman/listinfo/python-list

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


RE: the python name

2019-01-04 Thread Avi Gross
Oops. They autocorrected the word piethon below so it makes no sense. I
meant a pie-eating-marathon or whatever. 

-Original Message-
From: Python-list  On
Behalf Of Avi Gross
Sent: Friday, January 4, 2019 6:55 PM
To: python-list@python.org
Subject: RE: the python name

Gene,

It is simple in Python:

if "IV" in "FIVE":
print("Roman 4 is 5!")

prints:

Roman 4 is 5!

Just a stupid coincidence that the spelling in current English for the
numeral Five happens to have the silly one-less than 5 notation of the Roman
numerals IV. 

Maybe someone with my perverted sense of humor found it amusing to change
the nomenclature so WAT remains the same in WATFOR and in WATFIV but they
did not retain the FOR and make WATFORIV which might be harder to pronounce.

Now if they had named the language pithon or python instead of python, we
might be having marathon sessions evaluating digits of pi or eating dessert.

Time to stop posting before ...

-Original Message-
From: Python-list  On
Behalf Of Gene Heskett
Sent: Friday, January 4, 2019 4:20 PM
To: python-list@python.org
Subject: Re: the python name

On Friday 04 January 2019 13:22:03 Ian Kelly wrote:

> On Fri, Jan 4, 2019 at 10:59 AM Dennis Lee Bieber
 wrote:
> > On Fri, 4 Jan 2019 01:12:42 -0500, "Avi Gross"
> > 
> >
> > declaimed the following:
> > >language, Formula Translator? (I recall using the What For 
> > >version).
> >
> > WATFOR => WATerloo FORtran
>
> And then there was WATFIV, which stands for WATerloo Fortran IV.
> Because 5 == IV.

Not what I was taught 75 years ago. Thats a brand new definition of fuzzy
logic. :(

Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
--
https://mail.python.org/mailman/listinfo/python-list

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

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


Re: the python name

2019-01-04 Thread Michael Torrie
On 01/03/2019 06:35 PM, Gene Heskett wrote:
> On Thursday 03 January 2019 15:28:49 Grant Edwards wrote:
>> About 20 years ago, the RedHat Linux (way before RHEL) installer
>> (which was written in Python) was called Anaconda.

> Thanks for rescuing my old wet ram Grant, thats exactly what I was 
> thinking of. AIR, it wasn't anywhere near a "real installer" and I spent 
> a decent amount of time turning perfectly good air blue. 

On the other hand I never had any troubles with it, nor have I had any
problems with it recently.  Not sure what you mean about it not being
anywhere near a "real installer."

The non-linear redesign that came out a few years ago really threw me,
and I still don't like it.

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


RE: the python name

2019-01-04 Thread Avi Gross
I don't go back to the beginning of FORTRAN. My comment was not that FORTRAN
was badly named when it was among the first to do such things. I am saying
that in retrospect, almost any language can do a basic subset of arithmetic
operations. And there is nothing in principle that necessarily stops any
modern language code from being optimized by translators to be even more
rapid than the original versions of FORTRAN. If anything, I can well imagine
algorithms using parallel architectures from performing some operations way
faster. True, many languages tend to add overhead but that is not
necessarily required.

As some have said here, many things these days are fast enough not to need
ultimate optimization.

Having said that, there is no reason why code used over and over should not
be optimized. Functions in higher-level languages can be written using the
language and then can be replaced if there is a great enough improvement and
they do not need some of the interactive features the language might offer. 

Someone mentioned that in principle all data types can be stored in a
string. Python does have a concept of converting many, but not all data
structures into a byte form that can be written to files and restored or
sent to other processes including on other machines. Of course entire
programs written in text can be shipped this way to some extent. But when
your data is a long list of real numbers that you want to find the standard
deviation of, then converting it into a compact C/C++ array (or something
similar in Fortran) and calling a function in that language that works fast
on that, may be a good way to go. Why interpret a step at a time when one
pass generates the data that can be processed in tighter loops and a result
returned?

-Original Message-
From: Python-list  On
Behalf Of Dennis Lee Bieber
Sent: Friday, January 4, 2019 1:17 PM
To: python-list@python.org
Subject: Re: the python name

On Fri, 4 Jan 2019 11:34:24 -0500, "Avi Gross" 
declaimed the following:

>
>Although I used FORTRAN ages ago and it still seems to be in active use, I
am not clear on why the name FORMULA TRANSLATOR was chosen. I do agree it
does sound more like a computer language based on both the sound and feel of
FORTRAN as well as the expanded version.
>
>It seems to have been designed as a mathematical extension of sorts that
allowed you to evaluate a mathematical formula efficiently. I mean things
like quadratic equations. But there is overlap with what other languages
like COBOL or BASIC did at the time.
>

FORTRAN predates BASIC by a decade.

COBOL was never meant to be an in-depth number cruncher language
(original data type is packed BCD). Writing a quadratic equation in it
probably takes two or three pages (as I recall, the COMPUTE verb was a later
addition, so everything would have been long sentences: 
DIVIDE C BY B GIVING TMP1. MULTIPLY TMP1 BY 2. SUBTRACT TMP1 FROM A GIVING
RESULT1. ADD TMP1 TO A GIVING RESULT2. 
vs
COMPUTE TMP1 = (C / B) * 2. COMPUTE RESULT1 = A - TMP1. COMPUTE RESULT2 = A
+ TMP1. )

>What gets me is the vagueness of the words looked at by ME today. Any
modern computing language can do what standard FORTRAN does, albeit perhaps
more slowly as I know some languages do some of their math using libraries
from FORTRAN. But do we use the word TRANSLATOR quite that way much anymore?
Heck, do we use FORMULA in the same way?

Meanings change... "COMPUTER" means "one who computes" -- those poor
overworked engineers with slide-rules creating ballistic tables for
battleships.

"Translator" still applies -- in the sense of taking one language
(source) and producing the equivalent meaning in another language
(assembler, and then translating that to pure machine binary). "Formula"
has likely been superceded by "algorithm" (cf ALGOL)

>
>My most recent use of formula has been in the R language where there is a
distinct object type called a formula that can be used to specify models
when doing things like a regression on data. I am more likely to call the
other kind using words like "equation". Python has an add-on that does
symbolic manipulation. Did FORTRAN have any of these enhanced objects back
when created, or even now?

No body had symbolic manipulation when FORTRAN was created. At the
time, the goal was to produce a higher order language that the scientists
could write without having to /know/ the computer assembly/machine code,
with the hope that it could be portable at the source level. Users were
charged by the minute for CPU time, and operating systems were lucky to be
able to handle more than one program in parallel. Batch systems were the
norm -- where a program would run until it either finished, or it ran out of
CPU time (as specified on a LIMIT in the job control deck). One would turn
in a deck of cards to be spooled in the job queue, and come back some hours
later to get the printout from the job.



-- 
Wulfraed Dennis Lee

Re: the python name

2019-01-04 Thread Gene Heskett
On Friday 04 January 2019 19:18:46 Avi Gross wrote:

> Oops. They autocorrected the word piethon below so it makes no sense.
> I meant a pie-eating-marathon or whatever.
>
I did wonder about that, damn the spiel chucker's anyway.

> -Original Message-
> From: Python-list
>  On Behalf Of Avi
> Gross
> Sent: Friday, January 4, 2019 6:55 PM
> To: python-list@python.org
> Subject: RE: the python name
>
> Gene,
>
> It is simple in Python:
>
> if "IV" in "FIVE":
> print("Roman 4 is 5!")
>
> prints:
>
> Roman 4 is 5!
>
> Just a stupid coincidence that the spelling in current English for the
> numeral Five happens to have the silly one-less than 5 notation of the
> Roman numerals IV.
>
> Maybe someone with my perverted sense of humor found it amusing to
> change the nomenclature so WAT remains the same in WATFOR and in
> WATFIV but they did not retain the FOR and make WATFORIV which might
> be harder to pronounce.
>
> Now if they had named the language pithon or python instead of python,
> we might be having marathon sessions evaluating digits of pi or eating
> dessert.
>
> Time to stop posting before ...
>
> -Original Message-
> From: Python-list
>  On Behalf Of
> Gene Heskett
> Sent: Friday, January 4, 2019 4:20 PM
> To: python-list@python.org
> Subject: Re: the python name
>
> On Friday 04 January 2019 13:22:03 Ian Kelly wrote:
> > On Fri, Jan 4, 2019 at 10:59 AM Dennis Lee Bieber
>
>  wrote:
> > > On Fri, 4 Jan 2019 01:12:42 -0500, "Avi Gross"
> > > 
> > >
> > > declaimed the following:
> > > >language, Formula Translator? (I recall using the What For
> > > >version).
> > >
> > > WATFOR => WATerloo FORtran
> >
> > And then there was WATFIV, which stands for WATerloo Fortran IV.
> > Because 5 == IV.
>
> Not what I was taught 75 years ago. Thats a brand new definition of
> fuzzy logic. :(
>
> Cheers, Gene Heskett
> --
> "There are four boxes to be used in defense of liberty:
>  soap, ballot, jury, and ammo. Please use in that order."
> -Ed Howdershelt (Author)
> Genes Web page 
> --
> https://mail.python.org/mailman/listinfo/python-list
>
> --
> https://mail.python.org/mailman/listinfo/python-list


Cheers, Gene Heskett
-- 

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