Re: [Tutor] Python 3 for Beginners was: (Re: intro book for python)

2017-09-03 Thread Sri Kavi
Hi guys, this mailing list is for people trying to learn Python and this
list is here to help us all. It’s one of the hundreds of programming
languages in use today.  Use it as a tool and see if it can help you
accomplish your goal. If it fails to serve you, you’ve so many choices.
Every language has its advantages and issues.

On Sun, Sep 3, 2017 at 9:13 PM, Leam Hall  wrote:

> On 09/03/2017 10:06 AM, David Rock wrote:
>
>>
>> On Sep 3, 2017, at 08:55, Mats Wichmann  wrote:
>>>
>>> On 09/03/2017 04:02 AM, Leam Hall wrote:
>>>
>>> Anyone that uses python on Linux has to use Python 2.

>>>
>>> Every current distro I know of has a python 3 package, plus lots and
>>> lots of add-ons in python 3 mode.  It's quite easy to use python 3 as a
>>> result... and if that doesn't work you can install your own to your
>>> workspace (rather than as a "system package") just as easily.
>>>
>>
>> While a bit anecdotal, the complaint is valid.  Red Hat does not support
>> Python 3 in their base installation on RHEL and the only way to get it
>> “officially” (i.e., directly from Red hat) is through Software Collections,
>> which is a bit cumbersome to use and not available in all cases.  There are
>> a lot of places (including where I work) that frown heavily on using
>> packages that aren’t from the base repositories from the OS maintainers.
>>
>> Installing into “your own workspace” isn’t so easy when you are talking
>> about 2000 servers, either.  In order for me to write code that I know will
>> work across all the servers, I have to use python 2 because I know it will
>> be there.  I can’t say the same thing about python 3, and that’s not
>> something I’m likely to be able to fix within the bounds of company
>> procedures.
>>
>> So while the original statement is obviously false, the heart of why it
>> was said is functionally true.
>>
>
> Sorry; there's a significant gap between what I wrote and what I meant. My
> fault.
>
> If you use the OS system's Python then you're using Python 2. That will
> continue for the next five or more years. I'm in the same boat as David;
> installing Python 3 is a non-starter. That's not the case for a lot of
> folks, but if I'm going to write something there's a high probability that
> Python 3 won't be on the target machine.
>
> While I prefer 2 over 3, if I went in to work and everything was magically
> Python 3 based I wouldn't whine. Much.
>
> Sorry for the miscommunication earlier.
>
> Leam
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python 3 for Beginners was: (Re: intro book for python)

2017-09-03 Thread Leam Hall

On 09/03/2017 10:06 AM, David Rock wrote:



On Sep 3, 2017, at 08:55, Mats Wichmann  wrote:

On 09/03/2017 04:02 AM, Leam Hall wrote:


Anyone that uses python on Linux has to use Python 2.


Every current distro I know of has a python 3 package, plus lots and
lots of add-ons in python 3 mode.  It's quite easy to use python 3 as a
result... and if that doesn't work you can install your own to your
workspace (rather than as a "system package") just as easily.


While a bit anecdotal, the complaint is valid.  Red Hat does not support Python 
3 in their base installation on RHEL and the only way to get it “officially” 
(i.e., directly from Red hat) is through Software Collections, which is a bit 
cumbersome to use and not available in all cases.  There are a lot of places 
(including where I work) that frown heavily on using packages that aren’t from 
the base repositories from the OS maintainers.

Installing into “your own workspace” isn’t so easy when you are talking about 
2000 servers, either.  In order for me to write code that I know will work 
across all the servers, I have to use python 2 because I know it will be there. 
 I can’t say the same thing about python 3, and that’s not something I’m likely 
to be able to fix within the bounds of company procedures.

So while the original statement is obviously false, the heart of why it was 
said is functionally true.


Sorry; there's a significant gap between what I wrote and what I meant. 
My fault.


If you use the OS system's Python then you're using Python 2. That will 
continue for the next five or more years. I'm in the same boat as David; 
installing Python 3 is a non-starter. That's not the case for a lot of 
folks, but if I'm going to write something there's a high probability 
that Python 3 won't be on the target machine.


While I prefer 2 over 3, if I went in to work and everything was 
magically Python 3 based I wouldn't whine. Much.


Sorry for the miscommunication earlier.

Leam

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python 3 for Beginners was: (Re: intro book for python)

2017-09-03 Thread Chris Warrick
On 3 September 2017 at 12:02, Leam Hall  wrote:
mmend anything from the author of LPTHW after he had the
>> audacity to write this https://learnpythonthehardway.org/book/nopython3.html
>> about Python 3, in addition to which there are several vastly superior books
>> and/or tutorials anyway.
>>
>> Kindest regards.
>>
>> Mark Lawrence.
>
>
> There are lots of other books on Python, that's true. "Practical
> Programming" (Gries, Campbell, Montojo) is one I use.
>
> Are you going to toss "Learning Python" since Mark points out some of
> python's drift from it's core values?
>
> I appreciate that link. Zed's right.

Many of Zed’s argument are false and plain BS:
https://eev.ee/blog/2016/11/23/a-rebuttal-for-python-3/

> Python 3 isn't used by the OS tools on Red Hat, and that's that major Linux 
> vendor in the US.

This will change in RHEL 8, whenever that comes out: yum was replaced
by dnf a few versions of Fedora ago, and that’s written in Python 3.

> Anyone that uses python on Linux has to use Python 2. That means Python 3 is
> just one more language that requires work to install and maintain. I'm not
> seeing the benefits. How long has Python 3 been out? How many others are
> seeing the benefits of total change? When will people who say "you should
> upgrade" realize it's weeks or months of work with no real reason to do so?

You’re getting: sane Unicode support, f"strings", type hinting,
pathlib, asyncio, and a few more improvements.

> Yesterday I was coding and had to work around Python 3 dict.keys() returning
> a "dict_keys" type vs a list. Why did we need another type for this? I'm a
> coding beginner.

Performance and resource usage. If you use a list, Python needs to do
some extra work to convert internal data structures of a dict into a
list, and also store that new list in memory.

> I can talk a decent game in a few languages like python but
> I'm not experienced enough or smart enough to deal with these sorts of
> problems easily. Returning a new type, without significant benefit, makes it
> harder for people to progress in the language.

There are a lot of things that return iterators or other fancy types
instead of lists in Python 3 (eg. zip, range, all of itertools). You
can always iterate over those like you would, and if you need a list
for some reason, you can just call list(the_thing).

> Some years ago I wanted to play with an IRC bot sort of thing. Someone on
> Freenode #python mentioned Twisted so I got that and started playing. Half
> an hour, maybe forty five minutes later and my little project did what I was
> trying to do. This was before I really knew any python; the language was
> that clean and easy to learn.

You can still do that with Python 3. (Although you’ll be better off
using asyncio and some IRC lib for that.)

-- 
Chris Warrick 
PGP: 5EAAEA16
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python 3 for Beginners was: (Re: intro book for python)

2017-09-03 Thread David Rock

> On Sep 3, 2017, at 08:55, Mats Wichmann  wrote:
> 
> On 09/03/2017 04:02 AM, Leam Hall wrote:
> 
>> Anyone that uses python on Linux has to use Python 2. 
> 
> Every current distro I know of has a python 3 package, plus lots and
> lots of add-ons in python 3 mode.  It's quite easy to use python 3 as a
> result... and if that doesn't work you can install your own to your
> workspace (rather than as a "system package") just as easily.

While a bit anecdotal, the complaint is valid.  Red Hat does not support Python 
3 in their base installation on RHEL and the only way to get it “officially” 
(i.e., directly from Red hat) is through Software Collections, which is a bit 
cumbersome to use and not available in all cases.  There are a lot of places 
(including where I work) that frown heavily on using packages that aren’t from 
the base repositories from the OS maintainers.

Installing into “your own workspace” isn’t so easy when you are talking about 
2000 servers, either.  In order for me to write code that I know will work 
across all the servers, I have to use python 2 because I know it will be there. 
 I can’t say the same thing about python 3, and that’s not something I’m likely 
to be able to fix within the bounds of company procedures.

So while the original statement is obviously false, the heart of why it was 
said is functionally true. 


— 
David Rock
da...@graniteweb.com




___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python 3 for Beginners was: (Re: intro book for python)

2017-09-03 Thread Mats Wichmann
On 09/03/2017 04:02 AM, Leam Hall wrote:

> Anyone that uses python on Linux has to use Python 2. 

Every current distro I know of has a python 3 package, plus lots and
lots of add-ons in python 3 mode.  It's quite easy to use python 3 as a
result... and if that doesn't work you can install your own to your
workspace (rather than as a "system package") just as easily.

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python 3 for Beginners was: (Re: intro book for python)

2017-09-03 Thread Alan Gauld via Tutor
On 03/09/17 11:02, Leam Hall wrote:

> Anyone that uses python on Linux has to use Python 2. 

Errr, nope. I use python 3 on Linux all the time. My
last significant Python 2 program was about 4 years ago.
It may be true that the distro maintainers are still using
python 2 for historical reasons but that's got no relevance
to whether a Linux user would want to use Python 3 for
their own programs - even ones accessing the OS.

> I'm not seeing the benefits. How long has Python 3 been out? How many 
> others are seeing the benefits of total change? 

It's not a huge advantage, many of the changes in Python 3 are
theoretically based, cleaning up of how Python does things to
make them fit with what Computer Science teaches. That often
means that it becomes harder to use, but the long term payoff
is a better foundation for building new things in the future.
We may only see the real benefit of Python 3 when Python
4 comes out - which based on history should be in 2020!

> "you should upgrade" realize it's weeks or months of work with no real 
> reason to do so?

I would not advocate converting all the existing code to v3
just for the sake of it, but there is a good case for converting
programs as you upgrade them. Doing a single application
isn't a big hit if you are already doing work on it.

> Yesterday I was coding and had to work around Python 3 dict.keys() 
> returning a "dict_keys" type vs a list. Why did we need another type for 
> this? 

Because it makes the whole ecosystem more consistent and
ultimately more extendible. But I agree in purely pragmatic
terms, and especially for new programmers without a CS
background, Python 3 is much, much, harder to come to
terms with. And things like dict views and iterators
instead of simple lists are a big part of that. If I was
writing my original "Learn to Program" book now, I'm not
sure I'd still pick Python. On the other hand, I can't
think of any other language that is a lot better for
teaching raw beginners, while still being useful in the
real world.

> these sorts of problems easily. Returning a new type, without 
> significant benefit, makes it harder for people to progress in the 
> language.

The difference is that python has entered the world of computing
professionals. Its now being used for industrial scale projects
by programming professionals who have a CS background. They
expect the language to behave in certain ways. They expect it
to be able to handle large data volumes without crashing
(huge lists getting loaded into memory for example) Many
of the changes accommodate that audience rather than the
total newbie.

> language was that clean and easy to learn.

It was easy to learn but it had lots of not so nice
things inside. Python 3 has tried to tidy itself up, and
industrialize itself but does so at the expense of adding
complexity for beginners.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Python 3 for Beginners was: (Re: intro book for python)

2017-09-03 Thread Leam Hall

On 09/03/2017 12:10 AM, Mark Lawrence via Tutor wrote:

On 01/09/17 18:51, Raghunadh wrote:

Hello Derek,

I would start with this book

https://learnpythonthehardway.org

Raghunadh



I cannot recommend anything from the author of LPTHW after he had the 
audacity to write this 
https://learnpythonthehardway.org/book/nopython3.html about Python 3, in 
addition to which there are several vastly superior books and/or 
tutorials anyway.


Kindest regards.

Mark Lawrence.


There are lots of other books on Python, that's true. "Practical 
Programming" (Gries, Campbell, Montojo) is one I use.


Are you going to toss "Learning Python" since Mark points out some of 
python's drift from it's core values?


I appreciate that link. Zed's right. Python 3 isn't used by the OS tools 
on Red Hat, and that's that major Linux vendor in the US. Has SuSE 
converted all OS tools to require Python 3? Ubuntu 18 is supposed to be 
Python 3 only, whenever it gets out.


Anyone that uses python on Linux has to use Python 2. That means Python 
3 is just one more language that requires work to install and maintain. 
I'm not seeing the benefits. How long has Python 3 been out? How many 
others are seeing the benefits of total change? When will people who say 
"you should upgrade" realize it's weeks or months of work with no real 
reason to do so?


Yesterday I was coding and had to work around Python 3 dict.keys() 
returning a "dict_keys" type vs a list. Why did we need another type for 
this? I'm a coding beginner. I can talk a decent game in a few languages 
like python but I'm not experienced enough or smart enough to deal with 
these sorts of problems easily. Returning a new type, without 
significant benefit, makes it harder for people to progress in the 
language.


Some years ago I wanted to play with an IRC bot sort of thing. Someone 
on Freenode #python mentioned Twisted so I got that and started playing. 
Half an hour, maybe forty five minutes later and my little project did 
what I was trying to do. This was before I really knew any python; the 
language was that clean and easy to learn.


I'd prefer Zed be wrong about Python dying. I'm not willing to put any 
money on it though.


Leam


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor