Closed FliiFe closed 8 years ago
So, judging by the code, it looks like this behavior is not wanted, but the logical operators are not bound correctly This is the code :
# Check for command line flags.
# If debug is on, print code, python code, separator.
# If help is on, print help message.
if (len(sys.argv) > 1 and
"-r" in sys.argv[1:]
or "--repl" in sys.argv[1:]) \
or all(flag in ("-d", "--debug") for flag in sys.argv[1:]):
Repl("-d" in sys.argv[1:] or "--debug" in sys.argv[1:]).cmdloop()
I like the behavior of entering the REPL with no flags. I agree that the code is written incorrectly (len(sys.argv) > 1 is unnecessary and placed wrong). If you want to execute code, you can just use -c
, what's wrong about that?
I removed that unnecessary check you mentioned.
The current behavior for the interpreter is to enter REPL mode when no argument is given, but you can't give code directly to stdin. For example, this
or
Will output this :
That is not a desired behavior.
So, could we execute code from stdin ?