473,776 Members | 1,529 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

docs patch: dicts and sets

This discussion ended abruptly, and I'd like to see it reach a
conclusion. I will attempt to synthesize Bill and Carsten's
proposals.

There are two proposed patches. The first is to
http://docs.python.org/lib/typesmapping.html
where it is proposed for footnote (3) to state:

Keys and values are listed in an arbitrary order. This order is
indeterminate and generally depends on factors outside the scope
of the containing program. However, if items(), keys(), values(),
iteritems(), iterkeys(), and itervalues() are called with no
intervening modifications to the dictionary, the lists will
directly correspond.

The second is for http://docs.python.org/lib/types-set.html
where the proposal is to append a new sentence to the 2nd paragraph:

Iteration over a set returns elements in an indeterminate
order,which generally depends on factors outside the scope of the
containing program.

Alan Isaac
May 15 '07 #1
12 1876
I submitted the language based on Bill and Carsten's proposals:

https://sourceforge.net/tracker/?fun...&group_id=5470

That language has been rejected.
You many want to read the discussion and see if
acceptible language still seems discoverable.

Alan Isaac
May 19 '07 #2
Alan Isaac wrote:
I submitted the language based on Bill and Carsten's proposals:

https://sourceforge.net/tracker/?fun...&group_id=5470

That language has been rejected.
You many want to read the discussion and see if
acceptible language still seems discoverable.
Seems to me that you're focusing on the wrong part of the docs. The
source of this "bug" is not sets or dicts, but the default __hash__
method implementation. Why don't you propose adding something like:

The default __hash__ method is based on an object's id(), and can
therefore change between different iterations of the same program.

to the docs for __hash__:

http://docs.python.org/ref/customization.html

Then if you really feel you need to add something for sets and dicts,
you can add a cross-reference to the __hash__ docs.

STeVe
May 19 '07 #3
On May 19, 9:06 am, Steven Bethard <steven.beth... @gmail.comwrote :
Alan Isaac wrote:
I submitted the language based on Bill and Carsten's proposals:
https://sourceforge.net/tracker/?fun...0&aid=1721372&...
That language has been rejected.
You many want to read the discussion and see if
acceptible language still seems discoverable.

Seems to me that you're focusing on the wrong part of the docs. The
source of this "bug" is not sets or dicts, but the default __hash__
method implementation. Why don't you propose adding something like:

The default __hash__ method is based on an object's id(), and can
therefore change between different iterations of the same program.

to the docs for __hash__:

http://docs.python.org/ref/customization.html

Then if you really feel you need to add something for sets and dicts,
you can add a cross-reference to the __hash__ docs.

STeVe

Here's an idea--add All the proposed changes to the docs. Why not
allow user's to add any explanations to the docs that they want? Then
readers can choose the explanations that make the most sense to them.
It would eliminate endless, petty discussions about what minutiae are
more important, and it would allow people to spend their time on more
productive efforts. And it would improve the docs exponentially.

May 19 '07 #4
7stud wrote:
On May 19, 9:06 am, Steven Bethard <steven.beth... @gmail.comwrote :
>Alan Isaac wrote:
>>I submitted the language based on Bill and Carsten's proposals:
https://sourceforge.net/tracker/?fun...0&aid=1721372&...
That language has been rejected.
You many want to read the discussion and see if
acceptible language still seems discoverable.
Seems to me that you're focusing on the wrong part of the docs. The
source of this "bug" is not sets or dicts, but the default __hash__
method implementation. Why don't you propose adding something like:

The default __hash__ method is based on an object's id(), and can
therefore change between different iterations of the same program.

to the docs for __hash__:

http://docs.python.org/ref/customization.html

Then if you really feel you need to add something for sets and dicts,
you can add a cross-reference to the __hash__ docs.

STeVe


Here's an idea--add All the proposed changes to the docs. Why not
allow user's to add any explanations to the docs that they want? Then
readers can choose the explanations that make the most sense to them.
It would eliminate endless, petty discussions about what minutiae are
more important, and it would allow people to spend their time on more
productive efforts. And it would improve the docs exponentially.
Except in those instances where users added information that was
explicitly wrong. Which any reader of this newsgroup knows is all too
easy to do. So there would need to be some editorial control. Which
would take effort that may not currently be available.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
------------------ Asciimercial ---------------------
Get on the web: Blog, lens and tag your way to fame!!
holdenweb.blogs pot.com squidoo.com/pythonology
tagged items: del.icio.us/steve.holden/python
All these services currently offer free registration!
-------------- Thank You for Reading ----------------

May 19 '07 #5
On May 19, 11:38 am, Steve Holden <s...@holdenweb .comwrote:
Except in those instances where users added information that was
explicitly wrong.
It's a self correcting mechanism. Other reader's will spot the error
and post corrections.

May 19 '07 #6
7stud wrote:
On May 19, 11:38 am, Steve Holden <s...@holdenweb .comwrote:
>Except in those instances where users added information that was
explicitly wrong.

It's a self correcting mechanism. Other reader's will spot the error
and post corrections.
The last thing I want to read in a language's documentation is an
ill-informed and sometimes interminable argument about a particular feature.

For documentation I'm all in favor of user contributions, but I believe
an editorial process is required to ensure readability. I am aware that
the documentation isn't perfect but it's pretty good, and I don't think
throwing it open to anyone (including, by the way, web spammers) to add
to it is necessarily the best way to improve it.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
------------------ Asciimercial ---------------------
Get on the web: Blog, lens and tag your way to fame!!
holdenweb.blogs pot.com squidoo.com/pythonology
tagged items: del.icio.us/steve.holden/python
All these services currently offer free registration!
-------------- Thank You for Reading ----------------

May 19 '07 #7
On May 19, 12:36 pm, Steve Holden <s...@holdenweb .comwrote:
The last thing I want to read in a language's documentation is an
ill-informed and sometimes interminable argument about a particular feature.
Yet some readers will be able to get to the bottom of an issue they
are having by reading those comments.

May 19 '07 #8
7stud wrote:
On May 19, 9:06 am, Steven Bethard <steven.beth... @gmail.comwrote :
>Alan Isaac wrote:
>>I submitted the language based on Bill and Carsten's proposals:
https://sourceforge.net/tracker/?fun...0&aid=1721372&...
That language has been rejected.
You many want to read the discussion and see if
acceptible language still seems discoverable.
Seems to me that you're focusing on the wrong part of the docs. The
source of this "bug" is not sets or dicts, but the default __hash__
method implementation. Why don't you propose adding something like:

The default __hash__ method is based on an object's id(), and can
therefore change between different iterations of the same program.

to the docs for __hash__:

http://docs.python.org/ref/customization.html

Then if you really feel you need to add something for sets and dicts,
you can add a cross-reference to the __hash__ docs.

Here's an idea--add All the proposed changes to the docs. Why not
allow user's to add any explanations to the docs that they want? Then
readers can choose the explanations that make the most sense to them.
It would eliminate endless, petty discussions about what minutiae are
more important, and it would allow people to spend their time on more
productive efforts.
Actually, it would just move the "endless, petty discussions about what
minutiae are more important" into the docs. I don't see how that's an
improvement.

STeVe
May 19 '07 #9
7stud wrote:
On May 19, 12:36 pm, Steve Holden <s...@holdenweb .comwrote:
>The last thing I want to read in a language's documentation is an
ill-informed and sometimes interminable argument about a particular feature.

Yet some readers will be able to get to the bottom of an issue they
are having by reading those comments.
And most will simply be confused.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

May 19 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1330
by: Dave Benjamin | last post by:
Hola, I made a backport of sets.py that will run on Jython 2.1. Here is a diff against the Python 2.3 version of sets.py. The changes were simple, but I may have made a mistake here or there, and since the unit tests depend on generators, it was too much trouble to try to test the module this way. I'd appreciate any help on testing it more thoroughly. So far, everything seems to be working fine. The majority of the changes were due to...
40
2994
by: Xah Lee | last post by:
is it possible in Python to create a function that maintains a variable value? something like this: globe=0; def myFun(): globe=globe+1 return globe
0
279
by: Edward Diener | last post by:
I am unable to install the .NET doc update NDP1.1-KB827821-X86-Enu.exe. My last MSDN was April of 2003 and when I try to install this download in order to get more current .NET information and examples I get the message: "The upgrade patch can not be installed by the Windows Installer service because the program to be updated may be missing, or the upgrade patch may update a different version of the program. Verify that the version to be...
90
10821
by: Christoph Zwerschke | last post by:
Ok, the answer is easy: For historical reasons - built-in sets exist only since Python 2.4. Anyway, I was thinking about whether it would be possible and desirable to change the old behavior in future Python versions and let dict.keys() and dict.values() both return sets instead of lists. If d is a dict, code like: for x in d.keys():
14
2298
by: rurpy | last post by:
Another Python docs problem... I was trying to use imp.find_module(). >>> imp.find_module("mymod", "./subdir") ImportError: No frozen submodule named ./subdir.mymod subdir/mymod.py definately exists, has reasonable permissions, etc.
3
1205
by: Kent Johnson | last post by:
There has been a lot of discussion here recently about making changes to the docs, and what new system should be in place, etc., wiki, etc. I occasionally chime in with a note that it's pretty easy to submit a doc patch through SourceForge and they are often accepted quickly. The point being that there is a system in place that in my experience works pretty well. Here is an example. This morning I noticed a minor discrepancy in the docs...
0
312
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 408 open ( -9) / 3585 closed (+20) / 3993 total (+11) Bugs : 968 open ( +8) / 6505 closed ( +7) / 7473 total (+15) RFE : 267 open ( +1) / 251 closed ( +0) / 518 total ( +1) New / Reopened Patches ______________________
12
1817
by: Bill Jackson | last post by:
I have a dictionary of dictionaries where the keys are typically very long tuples and repeated in each inner dictionary. The dictionary representation is nice because it handles sparseness well...and it is nice to be able to look up values based on a string rather than a number. However, since my keys are quite long, I worry that I am wasting a lot of memory. I'm looking for better data structures. Here is an example: .... ...
5
329
by: Alan Isaac | last post by:
This is an attempt to synthesize Bill and Carsten's proposals. (I'm changing the subject line to better match the topic.) http://docs.python.org/lib/typesmapping.html: for footnote (3) Keys and values are listed in an arbitrary order. This order is indeterminate and generally depends on factors outside the scope of the containing program. However, if items(), keys(), values(), iteritems(), iterkeys(), and itervalues() are called...
12
1719
by: 7stud | last post by:
Hi, 1) The shelve module doesn't list close() as a method. 2) The fnmatch module does not even mention translate(). I have a hard time believing I am the first one to notice those omissions. Are the docs just old and poorly maintained? Or, is there some reason those methods were omitted?
0
9627
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9462
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10060
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8951
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6721
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5367
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5492
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2859
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.