##// END OF EJS Templates
typing: add stub functions for `cext/charencoding`...
typing: add stub functions for `cext/charencoding` I'm not sure if it's better to have a separate file, and currently pytype doesn't really know how to handle these, so it's no help in figuring that out. Technically, these methods are part of the `mercurial.cext.parsers` module, so put them into the existing stub until there's a reason to split it out.

File last commit:

r50180:56f98406 default
r52834:e58f02e2 default
Show More
seq.py
33 lines | 667 B | text/x-python | PythonLexer
Gregory Szorc
global: use python3 in shebangs...
r46434 #!/usr/bin/env python3
Matt Harbison
tests: introduce 'seq.py' as a portable replacement for 'seq'...
r24360 #
# A portable replacement for 'seq'
#
# Usage:
# seq STOP [1, STOP] stepping by 1
# seq START STOP [START, STOP] stepping by 1
# seq START STEP STOP [START, STOP] stepping by STEP
Matt Harbison
tests: apply binary mode to output in seq.py...
r40809 import os
Matt Harbison
tests: introduce 'seq.py' as a portable replacement for 'seq'...
r24360 import sys
Matt Harbison
tests: apply binary mode to output in seq.py...
r40809 try:
import msvcrt
Augie Fackler
formatting: blacken the codebase...
r43346
Matt Harbison
tests: apply binary mode to output in seq.py...
r40809 msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
except ImportError:
pass
Matt Harbison
tests: introduce 'seq.py' as a portable replacement for 'seq'...
r24360 start = 1
if len(sys.argv) > 2:
start = int(sys.argv[1])
step = 1
if len(sys.argv) > 3:
step = int(sys.argv[2])
stop = int(sys.argv[-1]) + 1
Manuel Jacob
py3: remove xrange() compatibility code...
r50180 for i in range(start, stop, step):
Robert Stanca
py3: use print_function in seq.py
r28722 print(i)