import Control.Concurrent
import Data.Map.Lazy as LM
import Data.Map.Strict as SM
import System.IO.Unsafe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Use this file to write your solution for the Summer Code Jam 2020 Qualifier. | |
Important notes for submission: | |
- Do not change the names of the two classes included below. The test suite we | |
will use to test your submission relies on existence these two classes. | |
- You can leave the `ArticleField` class as-is if you do not wish to tackle the | |
advanced requirements. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# switch_0.py | |
# Runs actions/values as they are found | |
class FirstMatchFound(Exception): | |
pass | |
class InvalidResultTypeError(Exception): | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
import types | |
def attrfunc(func=None, **attrs): | |
if not func: | |
return functools.partial(attrfunc, **attrs) | |
return AttrFunc(func, **attrs) | |
class AttrFunc: | |
def __init__(self, func, **attrs): |
NewerOlder