Repository: vyperlang/vyper

Issue:
True False or true false
Currently, Vyper supports 2 ways to declare true/ false values. One is the python syntax ``True``, ``False``, and one which Vyper compiler explicitly support ``true``, ``false``.
This is a bit confusing on what should be used, what do you think the correct syntax should be?
Do you think the other syntax should be disabled?

#### Cute Animal Picture
![image](https://user-images.githubusercontent.com/10667901/38170064-7007ea40-3584-11e8-86c6-faa741d79a7b.png)




Discussion:
@jacqueswww I'm thinking we disallow the lowercase versions. Do you know why they're allowing as syntax?
Should only be 'True'.  No idea why we have both.
The weird thing is that the lowercased one is explicitly specified by the compiler and widely used in the source code. Do you think there is a special reason for that or we can just remove it?

<sub>Sent with <a href="http://githawk.com">GitHawk</a></sub>
I'd say sticking to the Pythonic keywords should be good.

One thing to note, lowercase true and false, if not compiler reserved, then could be used to write underhanded code... (reader thinks it's a literal, but it's a variable)

I think lowercase true and false should be unused reserved words. This way we don't get the ambiguity of two distinct sets of boolean literals, and also avoid someone naming a variable "true".
Same goes with `None`/`null`.
@daniel-jozsef Yes I agree, the plan is to leave true and false as reserved keywords.

I am thinking of making a banned keyword list in the compiler, what this would do is not allow any case of form some keywords such as "tRue" / "FalsE" etc. :smile_cat: 
Probably, all reserved words should be reserved case-insensitively, but only accepted by the compiler with correct case.

Resolving patch:
diff --git a/examples/safe_remote_purchase/safe_remote_purchase.v.py b/examples/safe_remote_purchase/safe_remote_purchase.v.py
--- a/examples/safe_remote_purchase/safe_remote_purchase.v.py
+++ b/examples/safe_remote_purchase/safe_remote_purchase.v.py
@@ -28,7 +28,7 @@ def __init__():
     self.value = floor(msg.value / 2) #The seller initializes the contract by
         #posting a safety deposit of 2*value of the item up for sale.
     self.seller = msg.sender
-    self.unlocked = true
+    self.unlocked = True
 
 @public
 def abort():
@@ -41,9 +41,9 @@ def abort():
 @payable
 def purchase():
     assert self.unlocked #Is the contract still open (is the item still up for sale)?
-    assert msg.value == (2*self.value) #Is the deposit the correct value?
+    assert msg.value == (2 * self.value) #Is the deposit the correct value?
     self.buyer = msg.sender
-    self.unlocked = false
+    self.unlocked = False
 
 @public
 def received():
diff --git a/vyper/parser/expr.py b/vyper/parser/expr.py
--- a/vyper/parser/expr.py
+++ b/vyper/parser/expr.py
@@ -126,12 +126,6 @@ def constants(self):
     def variables(self):
         if self.expr.id == 'self':
             return LLLnode.from_list(['address'], typ='address', pos=getpos(self.expr))
-        if self.expr.id == 'true':
-            return LLLnode.from_list(1, typ='bool', pos=getpos(self.expr))
-        if self.expr.id == 'false':
-            return LLLnode.from_list(0, typ='bool', pos=getpos(self.expr))
-        if self.expr.id == 'null':
-            return LLLnode.from_list(None, typ=NullType(), pos=getpos(self.expr))
         if self.expr.id in self.context.vars:
             var = self.context.vars[self.expr.id]
             return LLLnode.from_list(var.pos, typ=var.typ, location='memory', pos=getpos(self.expr), annotation=self.expr.id, mutable=var.mutable)


Test patch:
diff --git a/tests/compiler/test_bytecode_runtime.py b/tests/compiler/test_bytecode_runtime.py
--- a/tests/compiler/test_bytecode_runtime.py
+++ b/tests/compiler/test_bytecode_runtime.py
@@ -5,7 +5,7 @@ def test_bytecode_runtime():
     code = """
 @public
 def a() -> bool:
-    return true
+    return True
     """
 
     bytecode = compiler.compile(code)
diff --git a/tests/parser/syntax/test_bool.py b/tests/parser/syntax/test_bool.py
--- a/tests/parser/syntax/test_bool.py
+++ b/tests/parser/syntax/test_bool.py
@@ -9,7 +9,7 @@
     """
 @public
 def foo():
-    x: bool = true
+    x: bool = True
     x = 5
     """,
     ("""
@@ -51,13 +51,13 @@ def test_bool_fail(bad_code):
     """
 @public
 def foo():
-    x: bool = true
-    z: bool = x and false
+    x: bool = True
+    z: bool = x and False
     """,
     """
 @public
 def foo():
-    x: bool = true
+    x: bool = True
     z: bool = x and False
     """,
     """
diff --git a/tests/parser/syntax/test_list.py b/tests/parser/syntax/test_list.py
--- a/tests/parser/syntax/test_list.py
+++ b/tests/parser/syntax/test_list.py
@@ -132,7 +132,7 @@ def test() -> int128:
     """
 @public
 def test() -> int128:
-    a = [1, 2, true]
+    a = [1, 2, True]
     return a[0]
     """
 ]
diff --git a/tests/parser/syntax/test_maps.py b/tests/parser/syntax/test_maps.py
--- a/tests/parser/syntax/test_maps.py
+++ b/tests/parser/syntax/test_maps.py
@@ -172,7 +172,7 @@ def foo():
 nom: {c: int128}[3]
 @public
 def foo():
-    self.mom = {a: null, b: 5}
+    self.mom = {a: None, b: 5}
     """,
     """
 mom: {a: {c: int128}[3], b: int128}
diff --git a/tests/parser/syntax/test_missing_return.py b/tests/parser/syntax/test_missing_return.py
--- a/tests/parser/syntax/test_missing_return.py
+++ b/tests/parser/syntax/test_missing_return.py
@@ -29,7 +29,7 @@ def foo() -> int128:
     """
 @public
 def foo() -> int128:
-    if false:
+    if False:
         return 123
     """,  # For the time being this is valid code, even though it should not be.
 ]