question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Removing use_enum & use_datetime from from_dict() in favor of auto detection?

See original GitHub issue

Hi, why does the from_dict() function has use_enum & use_datetime as options, instead of an automatic isinstance({value_name}, {type_name(origin_type)}) check?

I think an instance check right at the beginning near the value is None check would also be useful for other special types like UUID, IPv4Address or Path where otherwise the current from_dict function would fail if it already contains a valid instance of the origin type.

Are you open for a pull request which removes the two options? Do you think it would even be possible? Or is it not inline with your design goals.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Fatal1tycommented, Feb 9, 2022

I’m closing this issue since use_enum and use_datetime were removed in version 3.0.

0reactions
Fatal1tycommented, Jan 3, 2022

Hi @ydylla

JFYI, since I recently implemented the dialects feature, I’m planning to remove use_bytes, use_enum, use_datetime parameters. These three parameters were added due to differences in third-party libraries and can now be replaced by dialects.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found