Custom Query (121 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (4 - 6 of 121)

1 2 3 4 5 6 7 8 9 10 11 12
Ticket Resolution Summary Owner Reporter
#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

#27 worksforme yaml.dump seems to be broken xi anonymous

Reported by anonymous, 8 years ago.

Description

I may be missing something here, but this seems to be broken:

Example that works:

>>> print yaml.dump({'name': "The Cloak 'Colluin'", 'depth': 5, 'rarity': 45, 'weight': 10, 'cost': 50000, 'flags': ['INT', 'WIS', 'SPEED', 'STEALTH']})
cost: 50000
depth: 5
flags: [INT, WIS, SPEED, STEALTH]
name: The Cloak 'Colluin'
rarity: 45
weight: 10

Portion of above example:

>>> print yaml.dump({'name': "The Cloak 'Colluin'", 'depth': 5})
{depth: 5, name: The Cloak 'Colluin'}

I would expect to get:

depth: 5
name: The Cloak 'Colluin'
#64 fixed yaml.dump and indentation: xi lal.george@…

Reported by lal.george@…, 7 years ago.

Description

In python, when I have :


y = {'x' : 3, z : [{'val' : 3}, {'val' : 4}]} yaml.dump(y, default_flow_style=False)


The result is: 'x: 3\nz:\n- val: 3\n- val: 4\n'

I believe there should be a space before each hypen.

Best,

Lal

1 2 3 4 5 6 7 8 9 10 11 12
Note: See TracQuery for help on using queries.