Skip to content

Commit e8b41be

Browse files
author
Sylvain MARIE
committed
Changelog and flake8 fix
1 parent cd48359 commit e8b41be

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

docs/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
### 1.1.0 - Now load objects from sequences and scalars too
4+
5+
- Objects (subclasses of `YamlAble` or `YamlObject2`) can now be loaded from both mappings, sequences and scalars. Codecs (subclasses of `YamlCodec`) can also support this feature. Fixes [#12](https://github.com/smarie/python-yamlable/issues/12)
6+
37
### 1.0.4 - better type hinting (mypy)
48

59
- Most type hints have been fixed, in particular for `@yaml_info`. Fixes [#11](https://github.com/smarie/python-yamlable/issues/11).

yamlable/main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,9 @@ def decode_yamlable(loader,
233233
for clazz in candidates:
234234
try:
235235
if clazz.is_yaml_tag_supported(yaml_tag):
236-
return read_yaml_node_as_yamlobject(cls=clazz, loader=loader, node=node, yaml_tag=yaml_tag) # type: ignore
236+
return read_yaml_node_as_yamlobject(
237+
cls=clazz, loader=loader, node=node, yaml_tag=yaml_tag
238+
) # type: ignore
237239
else:
238240
errors[clazz.__name__] = "yaml tag %r is not supported." % yaml_tag
239241
except Exception as e:
@@ -345,7 +347,7 @@ def _get_all_subclasses(typ, # type: Type[T]
345347
try:
346348
if to is not typ and to not in result and issubclass(to, typ): # is_subtype(to, typ, bound_typevars={}):
347349
result.append(to)
348-
except Exception:
350+
except Exception: # noqa
349351
# catching an error with is_subtype(Dict, Dict[str, int], bound_typevars={})
350352
pass
351353

0 commit comments

Comments
 (0)