Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18514 > unrolled thread

Re: Typed python comparison / code analysis questions

Started byChris Angelico <rosuav@gmail.com>
First post2012-01-05 07:38 +1100
Last post2012-01-05 07:38 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Typed python comparison / code analysis questions Chris Angelico <rosuav@gmail.com> - 2012-01-05 07:38 +1100

#18514 — Re: Typed python comparison / code analysis questions

FromChris Angelico <rosuav@gmail.com>
Date2012-01-05 07:38 +1100
SubjectRe: Typed python comparison / code analysis questions
Message-ID<mailman.4426.1325709486.27778.python-list@python.org>
On Thu, Jan 5, 2012 at 7:09 AM, Lucas Vickers <lucasvickers@gmail.com> wrote:
> 2) Is there a way to error when comparing variables of different types?

Yep. Use Python version 3.

>>> 1<"1"
Traceback (most recent call last):
  File "<pyshell#88>", line 1, in <module>
    1<"1"
TypeError: unorderable types: int() < str()

Chris Angelico

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web