Re: Python 3.0 - is this true?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cameron Simpson

    Re: Python 3.0 - is this true?

    On 08Nov2008 19:17, walterbyrd <walterbyrd@ina me.comwrote:
    | On Nov 8, 12:02 pm, Arnaud Delobelle <arno...@google mail.comwrote:
    | It goes well with duck typing.  It lets you know when you things happen
    | that you don't mean to happen.
    |
    | But doesn't that also make the language less flexible?

    No. All you need to do is define the comparison criterion so Python
    doesn't make an arbitrary guess.

    | For example, if I used C, I would never have to worry about assigning
    | a float to an integer variable. The language will not allow it.

    Hmm. I presume you've never used unions in C then?
    Or cast to void* then back to another pointer?
    C code can be written to pay a fair amount of attention to types
    and protect (or warn, depending) about a lot of typing issues.
    But you can also, either deliberately or through sloppiness,
    do all sorts of nasty type mangling, including assigning a float
    into space used elsewhere as an integer variable.

    | I
    | thought that python's flexibility, in regard to that sort of thing,
    | was supposed to be one of python's great strengths.
    | Would it be better if python lists only accepted one type of data?

    No. That would be less flexible.

    | Wouldn't that even go further to let you know when things happen, that
    | you don't mean to happen?

    If I meant to put different types in a list, then this would be a
    serious problem.
    --
    Cameron Simpson <cs@zip.com.auD oD#743

Working...