Skip to content
Discussion options

You must be logged in to vote

The extra info is super relevant here. So since you defined the default_value as None, that will effectively treat missing values as None, allowing you to avoid undefined symbol errors being raised, thus making rule evaluation a bit more permissive. As for why the one rule works and the other doesn't, it's the same behavior you'd see in Python. It's safe to compare None to a string via the equality operator but you can't compare None to an integer with the greater-than operator.

>>> surname = None
>>> age = None
>>> surname == 'James'
False
>>> age > 10
Traceback (most recent call last):
  File "<python-input-3>", line 1, in <module>
    age > 10
TypeError: '>' not supported between insta…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@anietopltx
Comment options

Answer selected by anietopltx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants