[program-l] Re: Silly Python Question

  • From: "R Dinger" <rrdinger@xxxxxxxxxx>
  • To: <program-l@xxxxxxxxxxxxx>
  • Date: Tue, 16 Oct 2012 11:16:54 -0700

Hi Jim,

As Tyler mentioned, len is a convenience function that returns the length of 
any object implementing an __len__ attribute.  Typically that is a container 
object like a list or dictionary.

del is a language keyword that unbinds a reference, the opposite of assignment 
which binds a  reference.  Note it does not delete an object.
In Python, a file object is an instance of built-in type file . The built-in 
function open creates and returns a file object.

Richard
----- Original Message ----- 
From: Homme, James 
To: program-l@xxxxxxxxxxxxx 
Sent: Tuesday, October 16, 2012 6:08 AM
Subject: [program-l] Silly Python Question


Hi,

I tend to obsess about things sometimes. I was looking at the Python Standard 
Library documentation and reading about lists, dictionaries, and files, and I 
started to wonder why len, del, and open are part of the built-in's, if that's 
the right term, rather than methods of the objects called dictionary, list, and 
file. Just saying.



Jim







--------------------------------------------------------------------------------

This e-mail and any attachments to it are confidential and are intended solely 
for use of the individual or entity to whom they are addressed. If you have 
received this e-mail in error, please notify the sender immediately and then 
delete it. If you are not the intended recipient, you must not keep, use, 
disclose, copy or distribute this e-mail without the author's prior permission. 
The views expressed in this e-mail message do not necessarily represent the 
views of Highmark Inc., its subsidiaries, or affiliates.

Other related posts: