Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #72068 > unrolled thread

Re: confused about the different built-in functions in Python

Started byDeb Wyatt <codemonkey@inbox.com>
First post2014-05-26 07:15 -0800
Last post2014-05-26 07:15 -0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: confused about the different built-in functions in Python Deb Wyatt <codemonkey@inbox.com> - 2014-05-26 07:15 -0800

#72068 — Re: confused about the different built-in functions in Python

FromDeb Wyatt <codemonkey@inbox.com>
Date2014-05-26 07:15 -0800
SubjectRe: confused about the different built-in functions in Python
Message-ID<mailman.10345.1401117355.18130.python-list@python.org>
<snip>
> 
> On 5/25/14 7:55 PM, Deb Wyatt wrote:
>> I am confused about how various built-in functions are called.  Some are
>> called with dot notation
>> 
<snip
>>> How do you know/remember which way to call them?
>> 
>> TIA,
>> Deb in WA, USA
> 
> It can be confusing.  Generally, built-in functions (like sum, len, etc)
> are used when the operation could apply to many different types.  For
> example, sum() can be used with any iterable that produces addable
> things.
> 
> Operations that are defined only for a single type (like .isalpha as a
> string operation) are usually defined as methods on the type.
> 
> This is not a black/white distinction, I'm sure there are interesting
> counter-examples.  But this is the general principle.
> 
> --
> Ned Batchelder, http://nedbatchelder.com
> 
> --
> https://mail.python.org/mailman/listinfo/python-list

Thank you for answering.  I meant to send this to the tutor list, but messed up.  So, I guess there isn't a magic answer to this one, and I'll learn as I learn the language.  Have a great day.

Deb in WA, USA

____________________________________________________________
FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
Check it out at http://www.inbox.com/earth

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web