Path: ...!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: vallor Newsgroups: comp.lang.python Subject: glibc strverscmp called from python Date: Thu, 20 Jun 2024 22:13:51 -0000 (UTC) Organization: A noiseless patient Spider Lines: 68 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 21 Jun 2024 00:13:51 +0200 (CEST) Injection-Info: dont-email.me; posting-host="a414156ff05630fd2d65fa3742155188"; logging-data="2806751"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+16KFx8LGSKhX0FR1TkTck" User-Agent: Pan/0.159 (Vovchansk; 873418b; Linux-6.9.5) Cancel-Lock: sha1:ENqlIR48b2IblwUfGR9ikRoGvI8= X-Face: \}2`P"_@pS86<'EM:'b.Ml}8IuMK"pV"?FReF$'c.S%u9 0 def __eq__(self, other): return version_compare(self.s, other.s) == 0 def __le__(self, other): return version_compare(self.s, other.s) <= 0 def __ge__(self, other): return version_compare(self.s, other.s) >= 0 def __ne__(self, other): return version_compare(self.s, other.s) != 0 return K(s) # Function to escape special characters def shell_escape(s): return s.replace(" ", "\\ ").replace("\n", "\\n").replace("\t", "\\t") # Parse command-line arguments args = sys.argv[1:] # Sort the list using the version key sorted_args = sorted(args, key=version_key) # Print each sorted, escaped value on a new line for arg in sorted_args: print(shell_escape(arg)) - -%<- - -- -v