Skip to content

Instantly share code, notes, and snippets.

View Zheaoli's full-sized avatar
🇯🇵
Travel In Japan

Nadeshiko Manju Zheaoli

🇯🇵
Travel In Japan
View GitHub Profile
import operator
class ABC():
def __init__(self,value=0):
self.value=value
def __iadd__(self,y):
print(y)
self.value+=y
a=ABC()
def func3():
print(a.value,id(a))
Python debug information
========================
Py_DEBUG: No (sys.gettotalrefcount() missing)
builtins.float.double_format: IEEE, little-endian
builtins.float.float_format: IEEE, little-endian
locale.encoding: UTF-8
os.cpu_count: 8
os.cwd: /Users/lizheao/.pyenv/cache/Python-3.7.0b5
os.environ[HOME]: /Users/lizheao
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import codecs
import random
import string
from hashlib import md5
from multiprocessing import Pool
PROCESSES = 10
LENGTH = 8192*10
@Zheaoli
Zheaoli / pycon.py
Last active September 30, 2018 06:51
with python as my_love:
where_and_when = {
"country": "China",
"year": 2018
}
my_love.show(**where_and_when)
class PyCon:
"""
Where Are You
class BaseMetaClass(type):
"""
装饰器元类
"""
def __new__(mcs, name, bases, namespace):
namespace['get_data'] = cache_wrap(namespace['get_data'])
return super().__new__(mcs, name, bases, namespace)
def cache_wrap(func: typing.Callable) -> typing.Callable:
@functools.wraps(func)
async def func_wrap(*args, **kwargs) -> typing.Dict[str, typing.Any]:
"""
:param phone:
:param kwargs:
:return: 所有有标签的用户列表
"""
need_cache = kwargs.get("need_cache")
import copy
class Solution:
direction = [[0, 1], [0, -1], [1, 0], [-1, 0]]
def exist(self, board, word):
"""
:type board: List[List[str]]
:type word: str

关于捕蛇者说

在经过一些波折之后,捕蛇者说终于和大家见面了。

恩,是的没错,这是一档以编程为主体,兼职聊聊其余领域的播客节目。至于为什么叫捕蛇者说 呢?嘛,因为我们四位初创者 @laike9m、@laixintao、@Adam Wen、@Manjusaka 都是 Python 爱好者。所以就套用大家都学过的散文名篇《捕蛇者说》啦

当然,我们没有借用原文本意,这单纯的只是四个选择困难癌晚期患者对一个好口彩名字无奈的挣扎(笑(逃

在播客中,我们每次节目分享一些好玩,有意义,有价值的东西,你可能会在我们的节目中听到这样一些内容

from typing import *
class Solution:
def updateMatrix(self, matrix: List[List[int]]) -> List[List[int]]:
if not matrix:
return []
distance = []
for i in range(len(matrix)):

这篇是一个教程的文章,虽然在播客中也提到了这个问题。但是我觉得可以写个文章来聊聊这事

吐槽的由来

我相信每个人在不同的群里肯定都遇到过这样的情况

  1. 有没有xxx方面的大神的啊

  2. xxx 怎么运行不了啊(没有代码,没有异常的截图)