Boo
  1. Boo
  2. BOO-192

duck typing - indexed property access

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.7
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      l as duck = [1, 2, 3]
      assert 1 == l[0]
      assert 3 == l[-1]

        Activity

        Hide
        Doug H added a comment -

        Another example:

        json = {'A':"B",'C':[1,null,3,"ABC",

        {"D":56,"E":"JSON"}

        ]}

        //won't work with or without duck typing
        print json["C"][4]["E"]

        This JSON format can be used as an alternative to XML. See http://www.crockford.com/JSON/index.html

        Show
        Doug H added a comment - Another example: json = {'A':"B",'C':[1,null,3,"ABC", {"D":56,"E":"JSON"} ]} //won't work with or without duck typing print json ["C"] [4] ["E"] This JSON format can be used as an alternative to XML. See http://www.crockford.com/JSON/index.html

          People

          • Assignee:
            Rodrigo B. de Oliveira
            Reporter:
            Rodrigo B. de Oliveira
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: