Custom Query (132 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (25 - 27 of 132)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Ticket Resolution Summary Owner Reporter
#42 wontfix List objects are unhashable xi dfnord@…

Reported by dfnord@…, 7 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))
#48 wontfix yaml.load does not call __init__ of objects xi aymanbahrain@…

Reported by aymanbahrain@…, 7 years ago.

Description

I noticed that my init code is not called when an object is created via yaml.load. Try this one: In this example, fy.secret will raise an error about secret not an attribute of fy object.

import yaml

class Field:
    def __init__(self):
        print 'init called'
        self.secret = 'password'
        
f = Field()

print f.secret

fy = yaml.load(file('fld.yaml', 'r'))
print fy.hide_value               
print fy.secret

have fld.yaml contain:
!!python/object:__main__.Field 
hide_value: true

#58 wontfix Is there a way?? xi john.mcginnis@…

Reported by john.mcginnis@…, 7 years ago.

Description
a = yaml.load("""
   name: John
   number: 111
""")

print a
{'name': 'John', 'number': 111}

ok so if I do:

print yaml.dump(a) 
{name: John, number: 11}

and

print yaml.dump(a, default_flow_style=False)
name: John
number: 111

My question is, is there a variable in the code that could make the block style the default output without having to reference the style preference all the time?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Note: See TracQuery for help on using queries.