[issue30031] Improve queens demo (use argparse and singular form)

2017-04-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: After more thought on the subject, I think the n-queens demo should be left as is. The demo is principally about the class and not about being a command-line tool. Also, it is reasonable and appropriate to use sys.argv directly for such a simple API.

[issue30031] Improve queens demo (use argparse and singular form)

2017-04-17 Thread Louie Lu
Louie Lu added the comment: Pavlo, you are right, making the argument have backward compatible is good. String quote I'll prefer `'` more than `"`. -- ___ Python tracker

[issue30031] Improve queens demo (use argparse and singular form)

2017-04-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: Please focus on the task at hand and don't worry about PEP-8ing the existing code. -- nosy: +rhettinger ___ Python tracker

[issue30031] Improve queens demo (use argparse and singular form)

2017-04-17 Thread Pavlo Kapyshin
Pavlo Kapyshin added the comment: Louie Lu, thank you for the review. Different quotes were already used in file, so someone should decide which ones must be used: single or double. Regarding the -n option, I tried to be backwards compatible. Again, a decision is needed. The only place where

[issue30031] Improve queens demo (use argparse and singular form)

2017-04-17 Thread Louie Lu
Louie Lu added the comment: I make some review at GitHub. Do David and Terry suggest to also fix the problem about PEP8 coding style, since this demo have many places didn't fit PEP8. -- nosy: +louielu ___ Python tracker

[issue30031] Improve queens demo (use argparse and singular form)

2017-04-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: I prefer use of argparse. Patch *looks* good reading it, but I cannot test yet. -- nosy: +terry.reedy ___ Python tracker

[issue30031] Improve queens demo (use argparse and singular form)

2017-04-11 Thread Pavlo Kapyshin
Changes by Pavlo Kapyshin : -- pull_requests: +1228 ___ Python tracker ___ ___ Python-bugs-list

[issue30031] Improve queens demo (use argparse and singular form)

2017-04-10 Thread R. David Murray
R. David Murray added the comment: Yeah, I was wondering if part of the demo was to show something that can be done with no library support...but that probably isn't the case. -- ___ Python tracker

[issue30031] Improve queens demo (use argparse and singular form)

2017-04-10 Thread Eric V. Smith
Eric V. Smith added the comment: Oops, yes, __init__. Plenty of the demos use imports. I think it would be clearer with argparse, but I also don't feel strongly about it. -- ___ Python tracker

[issue30031] Improve queens demo (use argparse and singular form)

2017-04-10 Thread R. David Murray
R. David Murray added the comment: I'm not sure about using argparse. Currently the demo uses no imports. I'm not strongly against, though. Did you mean __init__ instead of __new__? Also, its value could be made True and False instead of 0 and 1. (Which tells you how old this demo is.)

[issue30031] Improve queens demo (use argparse and singular form)

2017-04-10 Thread Eric V. Smith
Eric V. Smith added the comment: I think these are reasonable improvements. Also, move the initialization of "silent" in to __new__. -- keywords: +easy nosy: +eric.smith ___ Python tracker

[issue30031] Improve queens demo (use argparse and singular form)

2017-04-10 Thread Pavlo Kapyshin
New submission from Pavlo Kapyshin: Currently Tools/demo/queens.py: - does manual sys.argv parsing - says “Found 1 solutions” I propose to: 1) use argparse; 2) if q.nfound == 1, use “solution”. I you are ok with this, I’ll make a pull request. -- components: Demos and Tools