Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    Maybe something like to_primitives, or transform_to_primitives? Commented Dec 31, 2021 at 14:17
  • I think it makes a huge difference if the function in stake just operates on a specific type SomeComplexClass, or several types, which is not clear to me from this question. If it can convert almost any kind of object, a generic name like to_dict is fine. Otherwise, I would recommend to specify the source type (or category of types) in the name. Commented Dec 31, 2021 at 19:17
  • Hey @DocBrown it does indeed work on multiple types. They do have the same base type, but they vary widely. Commented Jan 1, 2022 at 17:40
  • Well, then why not name it nameOfBaseType_to_dict? That should make it suffiently clear. Commented Jan 2, 2022 at 11:31
  • @DocBrown That could work, maybe entity_to_dict(), or entity_to_primitives(). Thanks. Commented Jan 2, 2022 at 20:36