Re: does lack of type declarations make Python unsafe?

Discussion in 'Python' started by David Abrahams, Jun 30, 2003.

  1. (David Abrahams) wrote in message news:<>...

    > Alex Martelli <> writes:
    >
    > > In Python one generally identifies (just as informally) a container as
    > > "an object which has a length" (using "length", perhaps a suboptimal
    > > choice of wording, to mean "number of items currently contained") and
    > > simultaneously express both 'c is a container' and
    > > 'that container is not empty' by

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    Sorry, I missed that.

    > >
    > > assert len(c)

    >
    > That understanding of "containerness" is, AFAICT, not universally held
    > among Pythonistas by any means.


    I still stand by the above.

    > Good thing too, probably: it looks
    > like there is no such thing as an empty container:
    >
    > >>> assert len([])

    > Traceback ...


    But that example was obviously just wrong.

    -Ddave
     
    David Abrahams, Jun 30, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christopher Blunck
    Replies:
    0
    Views:
    1,183
    Christopher Blunck
    Jun 24, 2003
  2. Mark 'Kamikaze' Hughes

    Re: does lack of type declarations make Python unsafe?

    Mark 'Kamikaze' Hughes, Jun 29, 2003, in forum: Python
    Replies:
    4
    Views:
    807
    Anton Vredegoor
    Jul 1, 2003
  3. Anton Vredegoor
    Replies:
    4
    Views:
    831
  4. Cameron Laird
    Replies:
    0
    Views:
    302
    Cameron Laird
    Jul 2, 2003
  5. rockdale
    Replies:
    3
    Views:
    3,285
    rockdale
    Nov 3, 2006
Loading...

Share This Page