PythonObjectible vs Alternative?

I’m having an OCD moment here regarding naming, specifically about PythonObjectible. To match other similar types, does PythonObjectable not fit better? Or some alternative?
Trivial I know, but while not a bug it’s still bugging me. :sweat_smile:

Here’s a list of a few similar types:

  1. Defaultable
  2. ImplicitlyBoolable
  3. ImplicitlyIntable
  4. Representable
  5. PythonObjectible ← Not like the others :grinning_face:
  6. Stringable
  7. Writable
  8. Floatable

Brainstorming possible alternatives:

  1. PythonConvertable
  2. PythonSetable
  3. PythonCapable
  4. PythonTypable
  5. PythonOperable or Interoperable
  6. Pythonable
  7. PythonProcessable
  8. PythonAccessable
  9. PythonRepresentable ** Better?
  10. PythonCompatible

I kinda like PythonRepresentable, but defer to the Modular team on the technical implications of ‘representable’.

Unfortunately, non of these alternatives seems to be correct. PythonObjectible (convertible to PythonObject) in current state says, that conforming to this trait will allow to convert to PythonObject and this is the main purpose.

Then PythonObjectible → PythonObjectable?
From a quick search, object [i] ble is not a word, so …ible becomes …able?
Making it similar to existing types.

Yeah, this looks better and still correct

1 Like

I’d like to acknowledge your OCD moment as the grammatically correct would be, I imagine, “PythonObjectifiable” though such a large word would be Objectionable.

The word “objectable” is in fact a word though considered rare.

2 Likes

Initial commit on Github by Chris Lattner:
[mojo-stdlib] Rework PythonObject list/tuple literal creation. (link)
“…
This patch introduces a new PythonObjectible trait (better name
suggestions welcome!) that has a single to_python_object()
requirement. This allows us to define these methods correctly in
terms of a trait instead of using static reflection.
…”

I think that I like PythonConvertable the most because it implies work being done as part of the conversion, letting users know it’s not free.

3 Likes

And it’s more generalisable. I also subconsciously used that spelling when talking about that on Discord, one datapoint for its naturalness I guess.

2 Likes

For me, this was first on my ‘alternatives’ list because it fell out naturally when I was thinking about what we intended to do…convert a Mojo object into a PythonObject.

1 Like

I’d suggest something like PythonConvertible

1 Like

Ugh, of course Convertible would be the correct spelling, versus Convertable which is not. PythonConvertible works for me. Better than PythonObjectible anyway. :sweat_smile:

Yep, “PythonConvertible” is what we called it in Swift: swift/docs/PythonInteroperability.md at main · tensorflow/swift · GitHub

2 Likes

It sounds like the team agreed that PythonConvertible would make sense - Joe went ahead with a rename.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.