%rtype crashes on dictionary/list object

Bug #1365747 reported by JBW
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Grasp
New
Undecided
Unassigned

Bug Description

print venues

{'meta': {'limit': 25, 'cache-expiry': 3600}, 'objects': [{'name': 'Pizza Hut', 'locality': 'Hayward', 'website_url': 'http://www.pizzahut.com/locations/california/hayward/011691', 'cuisines': [], 'region': 'CA', 'long': -122.081426, 'phone': '(510) 886-4111', 'postal_code': '94541', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.669377, 'id': '000674d43847740a1e4d', 'street_address': '22859 Mission Blvd.', 'resource_uri': '/v1_0/venue/000674d43847740a1e4d/'}, {'name': 'Vault 164', 'locality': 'San Mateo', 'website_url': 'http://www.vault164.com', 'cuisines': [], 'region': 'CA', 'long': -122.323592, 'phone': '(650) 348-8164', 'postal_code': '94401', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.566256, 'id': '0007199fc6af083a6268', 'street_address': '164 South B St.', 'resource_uri': '/v1_0/venue/0007199fc6af083a6268/'}, {'name': 'Mortar Pestle Thai Restaurant', 'locality': 'Union City', 'website_url': 'http://www.mortarpestlethai.com/', 'cuisines': [], 'region': 'CA', 'long': -122.066511, 'phone': '(510) 489-9990', 'postal_code': '94587', 'categories': ['restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.588186, 'id': '000ea2dad4df242ebb39', 'street_address': '32136 Alvarado Blvd.', 'resource_uri': '/v1_0/venue/000ea2dad4df242ebb39/'}, {'name': 'le truc', 'locality': 'San Francisco', 'website_url': 'http://www.eatletruc.com', 'cuisines': [], 'region': 'CA', 'long': -122.395859, 'phone': '(415) 904-8782', 'postal_code': '94107', 'categories': ['restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.778847, 'id': '0010b05136d23ceedeec', 'street_address': '470 Brannan St.', 'resource_uri': '/v1_0/venue/0010b05136d23ceedeec/'}, {'name': 'Super Suppers', 'locality': 'Fremont', 'website_url': 'http://www.supersuppersfremont.com', 'cuisines': [], 'region': 'CA', 'long': -121.983181853139, 'phone': '(510) 745-8270', 'postal_code': '94538', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.5495973724808, 'id': '0037c5a506dadf789e93', 'street_address': '39164 State St.', 'resource_uri': '/v1_0/venue/0037c5a506dadf789e93/'}, {'name': "Granucci's", 'locality': 'Pacifica', 'website_url': 'http://granuccis.blogspot.com', 'cuisines': [], 'region': 'CA', 'long': -122.491173, 'phone': '(650) 355-2000', 'postal_code': '94044', 'categories': ['restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.650886, 'id': '004c2de86bcc6ae6e9cd', 'street_address': '442 Manor Plz.', 'resource_uri': '/v1_0/venue/004c2de86bcc6ae6e9cd/'}, {'name': 'Shasta Beverages Inc', 'locality': 'Hayward', 'website_url': 'http://www.shastapop.com/', 'cuisines': [], 'region': 'CA', 'long': -122.109108, 'phone': '(510) 783-3200', 'postal_code': '94545', 'categories': ['restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.629522, 'id': '005d9dbf6c52af0e540a', 'street_address': '26901 Industrial Blvd.', 'resource_uri': '/v1_0/venue/005d9dbf6c52af0e540a/'}, {'name': 'Karakade Thai Cuisine', 'locality': 'Redwood City', 'website_url': 'http://www.karakadethai.com', 'cuisines': [], 'region': 'CA', 'long': -122.223305404186, 'phone': '(650) 365-4079', 'postal_code': '94061', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.4692616394217, 'id': '0066c334895f91eaae65', 'street_address': '593 Woodside Rd.', 'resource_uri': '/v1_0/venue/0066c334895f91eaae65/'}, {'name': 'Gourmet Express', 'locality': 'Milpitas', 'website_url': 'http://myfalafel.com', 'cuisines': [], 'region': 'CA', 'long': -121.915129, 'phone': '(408) 263-8388', 'postal_code': '95035', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.427656, 'id': '006710203bff0e536fa0', 'street_address': '463 Valley Way', 'resource_uri': '/v1_0/venue/006710203bff0e536fa0/'}, {'name': 'Mythos', 'locality': 'San Carlos', 'website_url': 'http://mythossancarlos.com', 'cuisines': [], 'region': 'CA', 'long': -122.261234, 'phone': '(650) 610-0202', 'postal_code': '94070', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.506192, 'id': '007649e1efdd889fa946', 'street_address': '1201 San Carlos Ave.', 'resource_uri': '/v1_0/venue/007649e1efdd889fa946/'}, {'name': 'Kabob.com', 'locality': 'San Jose', 'website_url': 'http://www.sjkabob.com', 'cuisines': [], 'region': 'CA', 'long': -121.884309, 'phone': '(408) 997-8522', 'postal_code': '95120', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.228797, 'id': '0077b27a2002697020ea', 'street_address': '6055 Meridian Ave., Ste 100', 'resource_uri': '/v1_0/venue/0077b27a2002697020ea/'}, {'name': 'Subway', 'locality': 'Milpitas', 'website_url': 'http://www.subway.com/', 'cuisines': [], 'region': 'CA', 'long': -121.875887, 'phone': '(408) 586-9522', 'postal_code': '95035', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.415854, 'id': '007c676ca264b0d69d5f', 'street_address': '1535 Landess Ave.', 'resource_uri': '/v1_0/venue/007c676ca264b0d69d5f/'}, {'name': u'Ph\u1edf 69', 'locality': 'San Jose', 'website_url': 'http://www.pho69noodle.com', 'cuisines': [], 'region': 'CA', 'long': -121.8869315608, 'phone': '(408) 289-8521', 'postal_code': '95113', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.3311754494154, 'id': '0080826af851307be705', 'street_address': '321 S. 1st St.', 'resource_uri': '/v1_0/venue/0080826af851307be705/'}, {'name': 'ABC Seafood - Foster City', 'locality': 'Foster City', 'website_url': 'http://www.abcseafoodrestaurant.com', 'cuisines': [], 'region': 'CA', 'long': -122.274302, 'phone': '(650) 328-2288', 'postal_code': '94404', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.556484, 'id': '008425584d365ebdc9b6', 'street_address': '973 E. Hillsdale Blvd.', 'resource_uri': '/v1_0/venue/008425584d365ebdc9b6/'}, {'name': 'Four Star Pizza and Deli', 'locality': 'Oakland', 'website_url': 'http://www.fourstarspizza.com', 'cuisines': [], 'region': 'CA', 'long': -122.22646, 'phone': '(510) 536-1930', 'postal_code': '94601', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.80066, 'id': '00ac6643519f6ced7c57', 'street_address': '3460 International Blvd.', 'resource_uri': '/v1_0/venue/00ac6643519f6ced7c57/'}, {'name': 'Florentine Trattoria', 'locality': 'Saratoga', 'website_url': 'http://www.florentinetrattoria.com/home.html', 'cuisines': [], 'region': 'CA', 'long': -122.033989, 'phone': '(408) 741-1784', 'postal_code': '95070', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.257221, 'id': '00c1a8ce8f369de68153', 'street_address': '14510 Big Basin Way # 11', 'resource_uri': '/v1_0/venue/00c1a8ce8f369de68153/'}, {'name': "Rosy's Fish City", 'locality': 'San Jose', 'website_url': 'http://www.rosysfishcity.com', 'cuisines': [], 'region': 'CA', 'long': -121.822231, 'phone': '(408) 272-2088', 'postal_code': '95127', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.35363, 'id': '00d480e687c6af262005', 'street_address': '2882 Story Rd.', 'resource_uri': '/v1_0/venue/00d480e687c6af262005/'}, {'name': 'Destino', 'locality': 'San Francisco', 'website_url': 'http://www.destinosf.com', 'cuisines': [], 'region': 'CA', 'long': -122.423926, 'phone': '(415) 552-4451', 'postal_code': '94103', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.771381, 'id': '00eb8fbd6da043498b1c', 'street_address': '1815 Market St.', 'resource_uri': '/v1_0/venue/00eb8fbd6da043498b1c/'}, {'name': 'Kin Khao', 'locality': 'San Francisco', 'website_url': 'http://www.kinkhao.com', 'cuisines': [], 'region': 'CA', 'long': -122.408964, 'phone': '(415) 362-7456', 'postal_code': '94110', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.784878, 'id': '00f95924ec9a81ae9b66', 'street_address': '55 Cyril Magnin', 'resource_uri': '/v1_0/venue/00f95924ec9a81ae9b66/'}, {'name': 'Subway', 'locality': 'San Leandro', 'website_url': 'http://www.subway.com/', 'cuisines': [], 'region': 'CA', 'long': -122.1300457, 'phone': '(510) 895-8522', 'postal_code': '94579', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.6891366, 'id': '01268158dcde2c0c8e0c', 'street_address': '15555 Hesperian Blvd.', 'resource_uri': '/v1_0/venue/01268158dcde2c0c8e0c/'}, {'name': 'Bar Tartine', 'locality': 'San Francisco', 'website_url': 'http://bartartine.com/', 'cuisines': [], 'region': 'CA', 'long': -122.4218, 'phone': '(415) 487-1600', 'postal_code': '94110', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.763881, 'id': '012fabb2f35ceb396985', 'street_address': '561 Valencia St.', 'resource_uri': '/v1_0/venue/012fabb2f35ceb396985/'}, {'name': 'La Penca Azul', 'locality': 'Alameda', 'website_url': 'http://www.lapencaazul.com', 'cuisines': [], 'region': 'CA', 'long': -122.241225242615, 'phone': '(510) 814-0560', 'postal_code': '94502', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.7379376530157, 'id': '0134169f63857c29d2e2', 'street_address': '891 Island Dr., Ste B', 'resource_uri': '/v1_0/venue/0134169f63857c29d2e2/'}, {'name': 'The Big 4', 'locality': 'San Francisco', 'website_url': 'http://www.big4restaurant.com/', 'cuisines': [], 'region': 'CA', 'long': -122.401895, 'phone': '(415) 474-5400', 'postal_code': '94104', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.790995, 'id': '013e2c903195b4abc035', 'street_address': 'California St.,', 'resource_uri': '/v1_0/venue/013e2c903195b4abc035/'}, {'name': 'Dogpatch Cafe', 'locality': 'San Francisco', 'website_url': 'http://www.dogpatchcafe.com/', 'cuisines': [], 'region': 'CA', 'long': -122.388396, 'phone': '(415) 255-9982', 'postal_code': '94107', 'categories': ['other', 'restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.760625, 'id': '0162e51002f2c5ffd76e', 'street_address': '2295 3rd St.', 'resource_uri': '/v1_0/venue/0162e51002f2c5ffd76e/'}, {'name': 'Chicago Steak and Fish', 'locality': 'Los Gatos', 'website_url': 'http://www.chicagosteakandfish.com', 'cuisines': [], 'region': 'CA', 'long': -121.981463, 'phone': '(408) 354-8858', 'postal_code': '95030', 'categories': ['restaurant'], 'has_menu': True, 'country': 'United States', 'lat': 37.227612, 'id': '0191a06835835fca49a1', 'street_address': 'N. Santa Cruz Ave.', 'resource_uri': '/v1_0/venue/0191a06835835fca49a1/'}]}

%gist venues

{builtin_function_or_method: [clear,
  copy,
  fromkeys,
  get,
  has_key,
  items,
  iteritems,
  iterkeys,
  itervalues,
  keys,
  pop,
  popitem,
  setdefault,
  update,
  values,
  viewitems,
  viewkeys,
  viewvalues]}

%rtype venues

---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-49-ef55e58c416c> in <module>()
----> 1 get_ipython().magic(u'rtype venues')

/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
   2203 magic_name, _, magic_arg_s = arg_s.partition(' ')
   2204 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2205 return self.run_line_magic(magic_name, magic_arg_s)
   2206
   2207 #-------------------------------------------------------------------------

/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
   2124 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
   2125 with self.builtin_trap:
-> 2126 result = fn(*args,**kwargs)
   2127 return result
   2128

/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/grasp/magic.pyc in rtype(self, line)

/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
    191 # but it's overkill for just that one bit of state.
    192 def magic_deco(arg):
--> 193 call = lambda f, *a, **k: f(*a, **k)
    194
    195 if callable(arg):

/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/grasp/magic.pyc in rtype(self, line)
    404 else:
    405 obj = eval(arg, self.shell.user_ns)
--> 406 return grasp.recursive_type(obj, **kw)
    407
    408 @IPython.core.magic.magics_class

/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/grasp/grasp.pyc in recursive_type(obj, max)
    198 return ('%s of %s %s' %
    199 (name(obj), shape(obj), name(contents(obj)[0])))
--> 200 elif rtypes_equal(contents(obj)):
    201 return ['%s of %s' %
    202 (name(obj), shape(obj)), recursive_type(contents(obj)[0])]

/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/grasp/grasp.pyc in rtypes_equal(els)
    171 """Return True if all rtypes equal"""
    172 first_type = recursive_type(els[0])
--> 173 return every([ recursive_type(el) == first_type for el in els])
    174 def types_equal(els):
    175 """Return True if all types equal"""

/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/grasp/grasp.pyc in recursive_type(obj, max)
    198 return ('%s of %s %s' %
    199 (name(obj), shape(obj), name(contents(obj)[0])))
--> 200 elif rtypes_equal(contents(obj)):
    201 return ['%s of %s' %
    202 (name(obj), shape(obj)), recursive_type(contents(obj)[0])]

/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/grasp/grasp.pyc in rtypes_equal(els)
    170 def rtypes_equal(els):
    171 """Return True if all rtypes equal"""
--> 172 first_type = recursive_type(els[0])
    173 return every([ recursive_type(el) == first_type for el in els])
    174 def types_equal(els):

/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/grasp/grasp.pyc in recursive_type(obj, max)
    198 return ('%s of %s %s' %
    199 (name(obj), shape(obj), name(contents(obj)[0])))
--> 200 elif rtypes_equal(contents(obj)):
    201 return ['%s of %s' %
    202 (name(obj), shape(obj)), recursive_type(contents(obj)[0])]

/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/grasp/grasp.pyc in rtypes_equal(els)
    171 """Return True if all rtypes equal"""
    172 first_type = recursive_type(els[0])
--> 173 return every([ recursive_type(el) == first_type for el in els])
    174 def types_equal(els):
    175 """Return True if all types equal"""

/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/grasp/grasp.pyc in recursive_type(obj, max)
    195
    196 if type(obj) in recursive_type_composite_types:
--> 197 if types_equal(contents(obj)) and types_simple(contents(obj)):
    198 return ('%s of %s %s' %
    199 (name(obj), shape(obj), name(contents(obj)[0])))

/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/grasp/grasp.pyc in types_equal(els)
    174 def types_equal(els):
    175 """Return True if all types equal"""
--> 176 first_type = type(els[0])
    177 return every([ type(el) is first_type for el in els])
    178 def types_simple(els):

IndexError: list index out of range

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.