[issue29089] dictionary keys described incorrectly in tutorial

2016-12-29 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I'm going to concur with the other respondents on this.  As a Python teacher, 
this is how I teach what should be used as a dictionary key.

While immutability and hashability aren't equivalent, it is a good first 
approximation.  Also, even though it is true that you could make a hashable 
object that is mutable, it is generally a bad practice that leads to regrets.

I'm going to close this.  If someone wants to change the styling of the 
tutorial, that can reasonably be discussed in another patch.

Thank you for your ideas, but we're going to pass on this one.  The tutorial is 
a place where it can be counter-productive to 1) make discussions too long, 2) 
go into atypical practices, 3) add too many caveats in a effort to be overly 
precise, etc.   Also, this part of the tutorial has been around for many years 
and has done a reasonably good job at educating its readers.

--
nosy: +rhettinger
resolution:  -> rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29089] dictionary keys described incorrectly in tutorial

2016-12-28 Thread R. David Murray

R. David Murray added the comment:

You know, it might actually not be a bad idea to use a slightly different color 
scheme for the tutorial.  We'll see if that idea generates any interest :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29089] dictionary keys described incorrectly in tutorial

2016-12-27 Thread Xezlec

Xezlec added the comment:

> Perhaps the sentence about a tuple pointing to a mutable could be tightened 
> up, though, by saying that if a tuple points to something that can not itself 
> be a dictionary key, then that tuple can not be a dictionary key.

That would be great.  Thank you.

> I feel assuming early part of tutorial as final word bad practice.

Alright.  If that's how both of you feel, then it can't be helped.

But if that's how it is, then maybe it would be a good idea to make the 
tutorial more distinct?  Right now, the only way I can tell Google has landed 
me on a tutorial page as opposed to a reference page is the word "tutorial" in 
the URL and in small print at the very top of the page.  They're styled 
similarly.  I never even realized they were separate things until today (let 
alone that one of them must be read skeptically).

Sorry to take up your time.  Thanks for listening.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29089] dictionary keys described incorrectly in tutorial

2016-12-27 Thread INADA Naoki

INADA Naoki added the comment:

> If precision is the problem, could it be reworded to be more vague?

"can be any immutable" seems vague enough to me.  It doesn't say "cannot be any 
mutable type.".

>  Users are likely to assume documentation from any official source is the 
> final word.

But tutorial should use less words as possible.  This section is before 
introducing "class" statement.  Only strings, numbers, list and set are 
introduced before section.

I feel assuming early part of tutorial as final word bad practice.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29089] dictionary keys described incorrectly in tutorial

2016-12-27 Thread R. David Murray

R. David Murray added the comment:

It is not wrong.  It does not say that keys are limited to immutables, only 
that immutables can be keys.  Perhaps the sentence about a tuple pointing to a 
mutable could be tightened up, though, by saying that if a tuple points to 
something that can not itself be a dictionary key, then that tuple can not be a 
dictionary key.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29089] dictionary keys described incorrectly in tutorial

2016-12-27 Thread Xezlec

Xezlec added the comment:

> It's the tutorial.  Probably better to just leave it alone.  Precise 
> understanding can come later.

But the problem isn't that it's imprecise.  It's flat-out wrong.  My opinion 
would be that it's always a bad idea to put wrong information in the 
documentation, especially when it's the first Google hit.  It can lead to all 
sorts of confusion and frustration (as it did for me).  Users are likely to 
assume documentation from any official source is the final word.

If precision is the problem, could it be reworded to be more vague?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29089] dictionary keys described incorrectly in tutorial

2016-12-27 Thread INADA Naoki

INADA Naoki added the comment:

> It's the tutorial.  Probably better to just leave it alone.  Precise 
> understanding can come later.

I agree.
Beginner should start using dict with builtin immutable type as key.
hashable is too complex at this point.

--
nosy: +inada.naoki

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29089] dictionary keys described incorrectly in tutorial

2016-12-27 Thread R. David Murray

R. David Murray added the comment:

Note that this applies equally well to python3.

--
title: Python 2 dictionary keys described incorrectly -> dictionary keys 
described incorrectly in tutorial
versions: +Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com