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
PIL | |
MySQL-python | |
Jinja2 |
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
# -*- coding: utf-8 -*- | |
'''以下のようなディレクトリ構成を想定する。 | |
├── src | |
│ ├── fizzbuzz | |
│ ├── __init__.py | |
│ └── main.py | |
└── test | |
├── __init__.py | |
├── test_flake8.py - このテストファイル | |
└── test_main.py - main.py 用テスト |
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
class Hoge(object): | |
def __init__(self, *args, **kwargs): | |
super(type(self), self).__init__() |
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 strict'; | |
var Hoge = Object.create(null); | |
Hoge.x = 10; | |
var h = Object.create(Hoge); | |
console.log(h.x); | |
// => 10 | |
Hoge.x = 20; | |
console.log(h.x); | |
// => 20 |
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 strict'; | |
var Hoge = Object.create(null); | |
Hoge.x = 10; | |
var h = Object.create(Hoge); | |
var f = Object.create(Hoge); | |
console.log(h.x); | |
// => 10 | |
console.log(f.x); | |
// => 10 |
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
(defun fact (n &optional m) ( | |
if (zerop n) | |
m | |
(fact (1- n) (if m (* m n) n)) | |
)) |
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
>>> lst = [] | |
>>> def deco(f): | |
... lst.append(f) | |
... | |
>>> @deco | |
... def main(): | |
... pass | |
... | |
>>> print(['{f.__module__}.{f.__name__}'.format(f=f) for f in lst]) | |
['__main__.main'] |
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
# coding: utf-8 | |
class Hoge(object): | |
x = 100 | |
hoge = Hoge() | |
print(hoge.x) | |
# => 100 |
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 strict'; | |
var Hoge = Object.create(null); | |
var h = Object.create(Hoge); | |
console.log(Hoge == Object.getPrototypeOf(h)); | |
// => true |
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 strict'; | |
(function() { | |
var proto = Hoge.prototype; | |
function Hoge() { | |
// some implements ... | |
} | |
// some implements ... | |
})(); |