Skip to content

Fix: replace double-underscore prefixes with single-underscore#71

Open
ZLeventer wants to merge 2 commits intolinkedin-developers:mainfrom
ZLeventer:fix/remove-dunder-prefixes
Open

Fix: replace double-underscore prefixes with single-underscore#71
ZLeventer wants to merge 2 commits intolinkedin-developers:mainfrom
ZLeventer:fix/remove-dunder-prefixes

Conversation

@ZLeventer
Copy link
Copy Markdown

Summary

  • Fixes Do not use double underscore prefixes in function names #29 — private helper functions used __ (double-underscore) prefixes, which triggers Python's name mangling mechanism
  • Name mangling is intended for inheritance conflict avoidance, not for marking functions as private
  • Renamed 11 functions across 3 files to use _ (single-underscore) convention:
    • encoder.py: 4 functions (__encode_query_param_map, __encode_string, __encode_list, __encode_dict)
    • decoder.py: 6 functions (__validateSuffix, __restli_unescape, __find_last_right_bracket, __internal_decode, __decode_list, __decode_object)
    • client.py: 1 method (__send_and_format_response) + all 15 call sites
  • Standard dunder methods (__init__, etc.) are untouched

Test plan

  • Run existing test suite — all tests should pass with no changes
  • Verify no external consumers are affected (these were all internal/private functions)

ZLeventer and others added 2 commits April 23, 2026 21:10
…g from batch create response

When the JSON response lacks an "elements" key, json_data.get() returns
None, which cannot be iterated. Default to an empty list instead, matching
the pattern already used by BatchFinderResponseFormatter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…edin-developers#29)

Python's double underscore prefix triggers name mangling, which is
inappropriate for regular private functions and methods. Renamed all
non-dunder `__` prefixed functions/methods to single underscore `_`
across encoder.py, decoder.py, and client.py.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not use double underscore prefixes in function names

1 participant