Custom Query (121 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (34 - 36 of 121)

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Ticket Resolution Summary Owner Reporter
#40 worksforme incomplete dict constructor xi dvd@…

Reported by dvd@…, 8 years ago.

Description

Hi all,

I'm puzzled by a strange behavior of yaml

If you run the attached script you obtain an output like this:

{'date': '732638',
'fields': {},
'guid': '0000010f153544cf8a314808007f000000000001',
'expiration': None}
{'date': '732638',
'fields': {'': {}, 'it': {'title': 'Hello World'}},
'guid': '0000010f153544cf8a314808007f000000000001',
'expiration': None}

*Please note the 'fields' value (I wrap the output to increase legibility)*

the first line is printed inside this custom constructor function:

def news_constructor(loader, node):
    nodes = loader.construct_mapping(node)
    print nodes
    return nodes

the second line (the correct one) is the print of the return values of this function

Can you help me or explain me this strange behavior?

#41 fixed Patch: Use types module instead of hand crafted entities and type(). xi v.haisman@…

Reported by v.haisman@…, 8 years ago.

Description

Hi, I have a patch that makes PyYAML use types module instead of hand crafted entities and type(). The motivation is that it silences some PyDev? error complains, like methods not having self parameter and such.

#42 wontfix List objects are unhashable xi dfnord@…

Reported by dfnord@…, 8 years ago.

Description

Even though yaml specification allows lists ("flow collections on yaml jargon") to be keys, pyaml fails to use them, as lists are unhashable.

For instance, loading "[1, 2]: something" gives the error "found unacceptable key (list objects are unhashable)"

As a away around this, flow collections could be translated into a simple hasheable subclass of list, such as:

class HasheableList(list):
    #############################
    ## Public Methods
    #############################
    def __hash__(self):
        return hash(tuple(self))
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Note: See TracQuery for help on using queries.