Skip to content
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

Documentation outdated for printline() #32

Open
btalb opened this issue Oct 27, 2021 · 3 comments
Open

Documentation outdated for printline() #32

btalb opened this issue Oct 27, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@btalb
Copy link
Contributor

btalb commented Oct 27, 2021

Commit 4251e79 seems to have added the strline() function for getting string representations as a replacement for printline(file=None).

Documentation for SE3 still suggests printline() will output a string when supplied with file=None:

printline

Documentation for the new strline() function also doesn't seem to have been built.

@jhavl
Copy link
Collaborator

jhavl commented Oct 27, 2021

Thanks for noticing that, the docs seem to be out of date on Github pages. I'll get those rebuilt with the next pip release

@petercorke
Copy link
Collaborator

I've changed this stuff a lot, used to be all done by printline. Are these the right primitives?

@btalb
Copy link
Contributor Author

btalb commented Nov 11, 2021

I haven't noticed a strong convention in the Python community for "making print flexible enough to meet user needs". There's the extendable custom string formatting, but that looks like it may be a deep rabbit hole.

If it was me, my approach would be maximise flexibility for users by minimising work done here:

  1. Have a single function that provides all possible "thing to string" conversion functionality
  2. Make something like NumPy's set_printoptions() to support changing the default string representation globally / in contexts using with (optional)
  3. Drop all support for sending the strings to files, and let users handle that through more generic Python methods available

With the flexibility of maybe swapping out 1 with custom string formatting if you feel the need in the future.

@petercorke petercorke added the enhancement New feature or request label Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants