bchao1 / bullet

🚅 Interactive prompts made simple. Build a prompt like stacking blocks.
https://pypi.org/project/bullet/
MIT License
3.55k stars 113 forks source link

TypeError: launch() got an unexpected keyword argument 'default' in 2.2.0 #67

Closed pzelnip closed 4 years ago

pzelnip commented 4 years ago

As of 2.2.0 I get: TypeError: launch() got an unexpected keyword argument 'default'. Example:

Python 3.8.2 (default, May 15 2020, 15:39:20) 
[Clang 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from bullet import Bullet, YesNo, colors
>>> 
>>> to_quit = YesNo("Ok to proceed? ").launch(default="n")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: launch() got an unexpected keyword argument 'default'

This works fine in 2.1.0. Is the default keyword arg now no longer supported?

I'm a bit puzzled too as the default kwarg is in the source: https://github.com/bchao1/bullet/blob/master/bullet/client.py#L371

pzelnip commented 4 years ago

Ahh, figured it out, the arg got moved from the launch() method to the constructor. Fixed with:

to_quit = YesNo("Ok to proceed? ", default="n").launch()

Closing this issue.