Changes between Initial Version and Version 1 of Ticket #169


Ignore:
Timestamp:
10/11/10 02:01:58 (4 years ago)
Author:
xi
Comment:

Using PyYAML API, you could provide a custom loader for !!dict nodes that handles this case in an application-specific way. However I think raising an error is a sane default behavior.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #169

    • Property Status changed from new to closed
    • Property Resolution changed from to wontfix
  • Ticket #169 – Description

    initial v1  
    1 The following YAML code is taken directly from an example given in the YAML 1.1 specification and fails to load with PyYAML, giving the error message: "found unacceptable key (unhashable type: 'list')". 
     1The following YAML code is taken directly from an example given in the YAML 1.1 specification and fails to load with PyYAML, giving the error message: `found unacceptable key (unhashable type: 'list')`. 
    22 
     3{{{ 
    34--- 
    45? - Detroit Tigers 
     
    1213    2001-08-14 ] 
    1314... 
     15}}} 
    1416 
    1517The problem most likely arises because Python lists are not hashable and cannot be used as dict keys.  A possible solution may be to detect this special case and coerce YAML !!seq types to Python tuples before constructing the dictionaries that they are a part of.