DanielStutzbach / blist

A list-like type with better asymptotic performance and similar performance on small lists
Other
310 stars 36 forks source link

Documentation of "Views" confusing #62

Open tallforasmurf opened 10 years ago

tallforasmurf commented 10 years ago

In the general Python documentation, a heading of the form "class modulename.CamelCase(blah)" indicates that CamelCase is a class that can be instantiated with statements such as

import modulename
camel = modulename.CamelCase(blah)

Indeed in the blist doc, the heading "class blist.sorteddict(...)" indicates just this. However later there are headings for "class blist.KeysView" and "class blist.ValuesView" and these classes can not be instantiated in the expected way. Rather one instantiates them by calling the keys() and values() methods respectively, of a sorteddict object. This can lead to some wasted time for the new user who attempts to execute "blist.KeysView()" and gets an unhelpful error message. Suggest at least adding a note to each section showing explicitly how to create a View object.