#20743: Parent.list() should return an immutable tuple
-------------------------------------+------------------------
       Reporter:  jsrn               |        Owner:
           Type:  defect             |       Status:  new
       Priority:  major              |    Milestone:  sage-7.3
      Component:  categories         |   Resolution:
       Keywords:  parent, immutable  |    Merged in:
        Authors:                     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
   Dependencies:                     |     Stopgaps:
-------------------------------------+------------------------

Comment (by kedlaya):

 Replying to [comment:5 vbraun]:
 > Types (class names) are nouns:
 > * list
 > * tuple
 >
 > Methods are verbs
 > * list
 >
 > Its perhaps unfortunate that there is no greater selection of
 appropriate verbs in English, but that linguistic details shouldn't be
 cause to have some ridiculous bug in Sage.

 A quick look at the Python docs
 (https://docs.python.org/3/library/stdtypes.html) shows that the following
 are all methods of basic types:
 {{{
 math.floor()
 math.ceil()
 int.bit_length()
 float.hex()
 list.index()
 str.title()
 str.upper()
 dict.keys()
 dict.values()
 dict.items()
 }}}
 This is definitely a minority of the methods one finds on that page, but
 it makes the point that insisting that method names be verbs is a good
 design principle, not an absolute rule; it definitely gets overridden when
 there is no simple alternative.

 For that matter, sometimes one can't even tell: is `foo.count()` a noun or
 a verb? It would be pretty un-Pythonic (and perhaps unfair to non-English
 speakers) to have `list` mean completely different things when interpreted
 as a noun vs. a verb, in addition to confusing the defined terms `list`
 and `tuple`.

--
Ticket URL: <http://trac.sagemath.org/ticket/20743#comment:11>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to