Modify ↓
Ticket #38 (closed defect: worksforme)
PySyck handles non-alphanumeric strings as references, others not
| Reported by: | thomas@… | Owned by: | xi |
|---|---|---|---|
| Priority: | normal | Component: | pysyck |
| Severity: | major | Keywords: | str |
| Cc: |
Description
>>> 'a' is 'a' True >>> 'a.' is 'a.' True >>> syck.dump(['a', 'a']) '--- \n- a\n- a\n' >>> syck.dump(['a.', 'a.']) '--- \n- &id001 a.\n- *id001\n' >>>
the first two commands show that python itself doesn't distinguish. This is especially problematic since the second case produces a segmentation fault when using syck-0.55-r3 (and surely other older versions).
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

It is possible in PySyck to forbid generating aliases for some specific kinds of identical objects. By default, the following heuristics is used: if an object is a number, or an empty tuple, or an alphanumerical string, aliases are not generated. You can override this by overriding the method Dumper.allow_aliases():
This code produces: