Skip to content

Doc: Clarify and improve documentation of ldap.ldapobject.LDAPObject #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 20, 2019

Conversation

encukou
Copy link
Member

@encukou encukou commented Jan 30, 2019

Use the full module in ldap.ldapobject.LDAPObject Doc

Previously, the class showed up as ldap.LDAPObject, which is wrong.

Note that the documentation on Read the Docs is currently not building (see #260). The SimpleLDAPObject and ReconnectLDAPObject entries show up fine with current master, but not on the published docs.

Fixes: #256

Clarify and improve documentation of ldap.ldapobject.LDAPObject

Originally, ldap.ldapobject.LDAPObject was meant as a read/write alias of the "default" connection class.
However, setting module attributes is bad practice (action at distance): it affects all users of python-ldap, some of which might not be aware of each other.

Clarify that:

  • initialize() is a thin wrapper around calling LDAPObject(),
  • it is fine and recommnended to instantiate LDAPObject-like classes directly, and
  • it is possible, but not recommended, to set ldap.ldapobject.LDAPObject to another class.

Fixes: #205

Previously, the class showed up as `ldap.LDAPObject`, which is wrong.

Fixes: python-ldap#256
Originally, `ldap.ldapobject.LDAPObject` was meant as a read/write
alias of the "default" connection class.
However, setting module attributes is bad practice (action at distance):
it affects all users of python-ldap, some of which might not be aware
of each other.

Clarify that:
* `initialize()` is a thin wrapper around calling `LDAPObject()`,
* it is fine and recommnended to instantiate LDAPObject-like classes
  directly, and
* it is possible, but not recommended, to set
  `ldap.ldapobject.LDAPObject` to another class.
@encukou encukou changed the title Doc: Use the full module in ldap.ldapobject.LDAPObject Doc: Clarify and improve documentation of ldap.ldapobject.LDAPObject Jan 30, 2019
@encukou
Copy link
Member Author

encukou commented Jan 30, 2019

Added another commit to fix #205:

Originally, ldap.ldapobject.LDAPObject was meant as a read/write alias of the "default" connection class.
However, setting module attributes is bad practice (action at distance): it affects all users of python-ldap, some of which might not be aware of each other.

Clarify that:
* initialize() is a thin wrapper around calling LDAPObject(),
* it is fine and recommnended to instantiate LDAPObject-like classes directly, and
* it is possible, but not recommended, to set ldap.ldapobject.LDAPObject to another class.

@codecov
Copy link

codecov bot commented Jan 30, 2019

Codecov Report

Merging #261 into master will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff           @@
##           master    #261   +/-   ##
======================================
  Coverage    71.1%   71.1%           
======================================
  Files          49      49           
  Lines        4818    4818           
  Branches      812     812           
======================================
  Hits         3426    3426           
+ Misses       1057    1056    -1     
- Partials      335     336    +1
Impacted Files Coverage Δ
Lib/ldap/controls/deref.py 57.14% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2059c13...17f3b48. Read the comment docs.

@encukou
Copy link
Member Author

encukou commented Sep 20, 2019

Merging without formal review, as this is not a code change.

@encukou encukou merged commit 4339169 into python-ldap:master Sep 20, 2019
@encukou encukou deleted the doc-ldapobjec branch September 20, 2019 13:04
@tiran tiran added this to the 3.3 milestone May 27, 2020
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.

Return ldap.initialize differ of the documentation What is the correct way to change LDAPObject from SimpleLDAPObject?
2 participants