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.

RFC: Remove `attribute` parameter from fields

See original GitHub issue

With data_key to designate the serialized key and the field name to designate the deserialized attribute, I can’t think of a use case for attribute. Are there cases where the field name would need to be different from the deserialized attribute?

h/t @taion

cc @lafrech @deckar01

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
taioncommented, Apr 8, 2019

It could make more sense just to discourage the use of attribute (and instead recommend data_key) in most cases, just to make the effective API surface area smaller.

1reaction
sloriacommented, Apr 7, 2019

This could be achieved using pre_dump to duplicate the value.

I guess, but that’s awkward. It feels wrong to set arbitrary attributes on an object.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC: replace load_from and dump_to with a single parameter ...
Regarding the name of the new attribute, I think name is as unintuitive as key . I like field . My only concern:...
Read more >
[RFC] Remove Types - MLIR - LLVM Discussion Forums
Step 1 would be to remove types from attributes, which itself would deduplicate a lot of code. But types and attributes would remain...
Read more >
RFC 7644 - System for Cross-domain Identity Management
Standards Track [Page 29] RFC 7644 SCIM Protocol Specification September 2015 3.5.1. Replacing with PUT HTTP PUT is used to replace a resource's...
Read more >
rfc2251.txt - » RFC Editor
Attribute Value A field of type AttributeValue takes on as its value either a string encoding of a AttributeValue data type, or an...
Read more >
2565-formal-function-parameter-attributes - The Rust RFC Book
Conditional compilation with #[cfg(..)] is also facilitated by allowing more ergonomic addition and removal of parameters. Moreover, procedural macro authors ...
Read more >

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