Custom Query (121 matches)
Results (4 - 6 of 121)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #48 | wontfix | yaml.load does not call __init__ of objects | xi | aymanbahrain@… |
| 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 |
| 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@… |
| 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,
|
|||
Note: See TracQuery
for help on using queries.
