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

Allow extra arguments to ic call #150

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Joaq33
Copy link

@Joaq33 Joaq33 commented Jun 24, 2023

This change allows you to add extra keyworded arguments to your ic function call.
This solves a problem that I faced when I wanted my list prints to be customized, but ic didn't allow me to change the argToStringFunction's optional arguments. As an example, the default function that works in the background to format the input, pprint.pformat, could accept the optional arguments such as compact, but ic doesn't handle those.

Code:

l = [111111, 222222, 333333, 444444, 555555, 666666, 777777, 888888, 999999, 101010, 111111]

ic(l, compact=True) # this would fails without this commit
ic(l)

Output:

ic| l: [111111, 222222, 333333, 444444, 555555, 666666, 777777, 888888, 999999, 101010,
        111111]
ic| l: [111111,
        222222,
        333333,
        444444,
        555555,
        666666,
        777777,
        888888,
        999999,
        101010,
        111111]

Also, this supports the usage of kwargs in user created argToStringFunction

*I hope you like it, this is my first open source contribution

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.

None yet

2 participants