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 json | |
class NestedDict(dict): | |
def __getitem__(self, key): | |
if key not in self: | |
return self.setdefault(key, NestedDict()) | |
return self.get(key) |
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
from __future__ import annotations | |
import thing as t | |
class Logger: | |
# This type hint would throw a circular error because | |
# without the __future__ import above. | |
# That import defers the execution of the typehint until after | |
# thing is fully initialized |
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
# Didn't know this worked | |
def fullname(first, middle, last): | |
print(f'{first} {middle} {last}') | |
fullname(last="Farwell", first='Ezekiel', middle="Boyle-O'Reilly") | |
# Definitely didn't know this worked! | |
def fullnamekw(first='First', middle='Middle', last='Last'): | |
print(f'{first} {middle} {last}') |
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
<?php | |
/** | |
* SupportDesk_FixAcl.php v1.1 | |
* SupportDesk (www.supportdesk.nu) | |
* 10/7/2015 | |
* | |
* NOTICE OF LICENSE | |
* | |
* This source file is subject to the Open Software License (OSL 3.0) | |
* It is available through the world-wide-web at this URL: |