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
$ iex -S mix main | |
Erlang/OTP 21 [erts-10.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace] | |
Request to pry #PID<0.99.0> at Mssum.main/0 (lib/mssum.ex:16) | |
14: | |
15: select_issue_fields = fn issue -> Map.take(issue, @issue_field) end | |
16: require IEx; IEx.pry | |
17: issues = | |
18: milestone | |
Allow? [Yn] y | |
Interactive Elixir (1.6.6) - press Ctrl+C to exit (type h() ENTER for help) |
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
if &compatible | |
set nocompatible | |
endif | |
set runtimepath+=/Users/man/.nvim/bundles/repos/github.com/Shougo/dein.vim | |
if dein#load_state('/Users/man/.nvim/bundles') | |
call dein#begin('/Users/man/.nvim/bundles') | |
call dein#add('/Users/man/.nvim/bundles/repos/github.com/Shougo/dein.vim') |
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 verbose_dataclasses import dataclass, field | |
from datatime import datetime | |
@dataclass(order=True, unsafe_hash=True) | |
class Employee: | |
emp_id: int = field() | |
name: str = field() | |
gender: str = field() | |
salary: int = field(hash=False, repr=False, metadata={'units': 'bitcoin'}) | |
age: int = field(hash=False) |
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 dataclasses import dataclass | |
@dataclass | |
class Color: | |
hue: int | |
saturation: float | |
lightness: float = 0.5 # default value |
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 typing import cast | |
possible_values = function_return_possible_values() | |
new_type = cast(new_type, possible_values) |
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
def f(l: List[str]) -> None: | |
s = l.pop() # reveal_type(s) -> str | |
def g(message: str = None) -> None: | |
if message is None: | |
return | |
reveal_type(message) # -> str |
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 typing import Type | |
def do_something(t: Type[SomeClass]) -> SomeClass: | |
... |
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 typing import NewType | |
USERID = NewType('USERID', int) | |
def get_username(id: USERID) -> str: | |
... |
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 typing import TypeVar | |
T = TypeVar('T') | |
def f(s: T) -> T: | |
... |
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 typing import Union | |
def f(s: Union[int, str]) -> None: | |
... |
NewerOlder