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

redirection convenience #857

Open
casperdcl opened this issue Dec 1, 2019 · 4 comments
Open

redirection convenience #857

casperdcl opened this issue Dec 1, 2019 · 4 comments
Labels
p4-enhancement-future 🧨 On the back burner question/docs ‽ Documentation clarification candidate submodule ⊂ Periphery/subclasses

Comments

@casperdcl
Copy link
Sponsor Member

@casperdcl casperdcl added p4-enhancement-future 🧨 On the back burner submodule ⊂ Periphery/subclasses question/docs ‽ Documentation clarification candidate labels Dec 1, 2019
@KOLANICH
Copy link

KOLANICH commented Dec 1, 2019

IMHO - classes used for redirection (including progressbar2 ones) should be moved into a separate package.

The things I deeply dislike about the redirection are that:

  • it modifies the global state. So we need a refcounting self-destructing singleton to properly support reentrying and multithreading.
  • it replaces the object with an own one. And that object doesn't mock sys.stdout well enough. For example it lacks flush. Libs may be using isinstance or using unimplemented details may be broken. But python 3.8 has audit hooks 1 2, I wonder if they can be used for modifying the output to stdout and stderr in a more safe way (without explicitly replacing an object).

@casperdcl
Copy link
Sponsor Member Author

I agree - and tqdm.contrib is a separate subpackage (part of #855)

@casperdcl
Copy link
Sponsor Member Author

Btw the new way does wrap everything (incl. flush() and any other members)

@KOLANICH
Copy link

KOLANICH commented Dec 1, 2019

tqdm.contrib is a separate subpackage

I mean a separate repo and a separate wheel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4-enhancement-future 🧨 On the back burner question/docs ‽ Documentation clarification candidate submodule ⊂ Periphery/subclasses
Projects
None yet
Development

No branches or pull requests

2 participants