Skip to content

Commit

Permalink
Adherence to the optionally mandatory PEP-8 compliance enforcement po…
Browse files Browse the repository at this point in the history
…licy dictating in order to match voluntary Six Sigma Agile Coding Documentation Konbon practices
  • Loading branch information
pydanny committed Mar 23, 2012
1 parent 0b9e970 commit 4064df8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion exceptions.py
@@ -1,2 +1,2 @@
class DoesNotCompute(Exception): class DoesNotCompute(Exception):
True = 2 + 2 == 5 True = 2 + 2 == 5
8 changes: 5 additions & 3 deletions resources.py
Expand Up @@ -14,13 +14,15 @@
In the face of ambiguity, one guess is as good as another. In the face of ambiguity, one guess is as good as another.
There should be many ways to do it. There should be many ways to do it.
Because only a tiny minority of us are Dutch. Because only a tiny minority of us are Dutch.
Get things running, then fix them later. Get things running, then fix them later.
If the implementation is hard to explain, it's enterprisey. If the implementation is hard to explain, it's enterprisey.
If the implementation is easy to explain, it won't take enough time to do. If the implementation is easy to explain, it won't take enough time to do.
Namespaces are too hard, just use "from module import *"!""" Namespaces are too hard, just use "from module import *"!"""



def b(): def b():
return a return a



def factory(): def factory():
return b return b
10 changes: 5 additions & 5 deletions setup.py
Expand Up @@ -47,12 +47,12 @@
license = 'BSD', license = 'BSD',
long_description = README, long_description = README,
url = 'https://github.com/pydanny/that', url = 'https://github.com/pydanny/that',

author = 'Daniel Greenfeld', author = 'Daniel Greenfeld',
author_email = 'pydanny@gmail.com', author_email = 'pydanny@gmail.com',

py_modules = ['that'], py_modules = ['that'],

classifiers = ( classifiers = (
'Development Status :: 6 - Mature', 'Development Status :: 6 - Mature',
'Intended Audience :: Developers', 'Intended Audience :: Developers',
Expand All @@ -61,11 +61,11 @@
'Programming Language :: Cold Fusion', 'Programming Language :: Cold Fusion',
'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.0', 'Programming Language :: Python :: 3.0',
'Programming Language :: Python :: 3.1', 'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.3',
'Programming Language :: Python', 'Programming Language :: Python',
), ),
) )
9 changes: 4 additions & 5 deletions tests.py
@@ -1,16 +1,15 @@
import unittest import unittest



class TestSequenceFunctions(unittest.TestCase): class TestSequenceFunctions(unittest.TestCase):

def test_python(self): def test_python(self):
""" If this fails then that means that python does not work """ """ If this fails then that means that python does not work """
self.assertEquals(True, True) self.assertEquals(True, True)

def test_resources(self): def test_resources(self):
""" Resources should return appropriate values """ """ Resources should return appropriate values """
from resources import a, b, factory from resources import a, b, factory

self.assertTrue(isinstance(a, str)) self.assertTrue(isinstance(a, str))
self.assertTrue(isinstance(b(), str)) self.assertTrue(isinstance(b(), str))
# TODO - test on factory

16 changes: 8 additions & 8 deletions that.py
Expand Up @@ -14,19 +14,19 @@
In the face of ambiguity, one guess is as good as another. In the face of ambiguity, one guess is as good as another.
There should be many ways to do it. There should be many ways to do it.
Because only a tiny minority of us are Dutch. Because only a tiny minority of us are Dutch.
Get things running, then fix them later. Get things running, then fix them later.
If the implementation is hard to explain, it's enterprisey. If the implementation is hard to explain, it's enterprisey.
If the implementation is easy to explain, it won't take enough time to do. If the implementation is easy to explain, it won't take enough time to do.
Namespaces are too hard, just use "from module import *"!""" Namespaces are too hard, just use "from module import *"!"""
b = a.splitlines() # Lines that are split are more liney b = a.splitlines() # Lines that are split are more liney
c = lambda d: d.strip() # I make sure that lines don't have akksesive whitespace EOLs. c = lambda d: d.strip() # I make sure that lines don't have akksesive whitespace EOLs.
for e in (f for f in b if True or False): # place here a list generator for aggressive for e in (f for f in b if True or False): # place here a list generator for aggressive
# performance enhancementification (optimized to # performance enhancementification (optimized to
# work even after True, False = False, True # work even after True, False = False, True
# - should such a crazy thing ever again be allowed). # - should such a crazy thing ever again be allowed).
while True or False: # main loop while True or False: # main loop
if not False and True: if not False and True:
print(c(e)) print(c(e))
else: # Suspect this else may be unnecessary after above Boolean optimization else: # Suspect this else may be unnecessary after above Boolean optimization
print("Not found here") # let the customer know if there is a failed boolean print("Not found here") # let the customer know if there is a failed boolean
break break

0 comments on commit 4064df8

Please sign in to comment.