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

Define pretty printers for more standard library modules #12

Open
6 of 15 tasks
tommikaikkonen opened this issue Jan 4, 2018 · 2 comments
Open
6 of 15 tasks

Define pretty printers for more standard library modules #12

tommikaikkonen opened this issue Jan 4, 2018 · 2 comments

Comments

@tommikaikkonen
Copy link
Owner

tommikaikkonen commented Jan 4, 2018

Here's a to-do list of standard library modules to write prettyprinter definitions for. This is just a list of the modules that I would personally find useful to have definitions for, so feel free to add to the list.

If it's not checked, it's not being worked on, so feel free to submit a PR. You can submit partial definitions for a module.

  • Built-in Exceptions
  • collections
  • re
  • functools (partial)
  • pathlib thanks @RazerM
  • logging
  • email
  • inspect (Signature, etc.)
  • ast
  • unittest.mock
  • urllib.parse (ParseResult, SplitResult)
  • ipaddress
  • argparse
  • io
  • hashlib

As the number of definitions grows, it may become infeasible to import all these modules along with prettyprinter to register their definitions. A mechanism for deferred type definition, such as the one used by IPython.lib.pretty would be useful.

@anntzer
Copy link
Contributor

anntzer commented Mar 11, 2019

fwiw it looks like functools.partial and urllib.parse have been taken care of?

In [1]: functools.partial(lambda x: x, y=1)
Out[1]: 
functools.partial(
    <lambda>,  # function
    1,
    y=1
)

In [2]: urllib.parse.urlsplit("http://www.google.com")
Out[2]: 
urllib.parse.SplitResult(
    scheme='http',
    netloc='www.google.com',
    path='',
    query='',
    fragment=''
)

In [3]: urllib.parse.urlparse("https://www.google.com")
Out[3]: 
urllib.parse.ParseResult(
    scheme='https',
    netloc='www.google.com',
    path='',
    params='',
    query='',
    fragment=''
)

@tommikaikkonen
Copy link
Owner Author

Yep, these are now taken care of 👍 I modified the checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants