当前位置:首页>python>Python高频面试问答(2):函数方法与高级特性

Python高频面试问答(2):函数方法与高级特性

  • 2026-07-01 03:19:21
Python高频面试问答(2):函数方法与高级特性

Python编程基础·面试精华(二):函数方法与高级特性

第1章 编程基础:Python · Part 2/5

涵盖函数与方法(6问)、Python高级特性(8问),共14个高频面试问答。

(接上篇)本篇继续 Python 面试精讲,聚焦函数方法和高级特性两大模块,包括实例方法vs类方法、*args/**kwargs、装饰器原理、迭代器与生成器,共 14 个高频问答。

三、函数与方法

17. Python中的实例方法、静态方法和类方法三者区别?

类型
装饰器
第一个参数
绑定对象
能访问实例属性
能访问类属性
实例方法
无(默认)
self
实例
类方法@classmethodcls
类本身
静态方法@staticmethod
无特殊参数
无绑定
❌(需通过类名访问)
PYTHON

class MyClass:

    class_var = "类变量"

def instance_method(self):

        """实例方法:可访问实例和类的属性"""

return f"实例方法: {self}, 类变量={MyClass.class_var}"

@classmethod

def class_method(cls):

        """类方法:只能访问类属性,常用于工厂方法"""

return f"类方法: {cls}, 类变量={cls.class_var}"

@staticmethod

def static_method(x, y):

        """静态方法:与普通函数无异,只是放在类的命名空间内"""

return x + y

obj = MyClass()

print(obj.instance_method())    # 通过实例调用

print(MyClass.class_method())   # 通过类调用

print(MyClass.static_method(1, 2))  # 无需实例

使用场景选择

  • 实例方法
    :需要访问或修改实例状态时 → 默认选择
  • 类方法
    :操作类级别的属性、工厂方法(如创建实例的替代构造函数)→ @classmethod
  • 静态方法
    :功能与类相关但不需要访问类/实例状态 → @staticmethod

AI实战示例——类方法避免重复加载模型

PYTHON

class Infer(object):

def __init__(self, cfg: dict) -> None:

self.cfg = cfg

self.load_model(self.cfg)

@classmethod

def load_model(cls, cfg: dict):

        """使用类方法确保模型只加载一次"""

cls.cfg = cfg

ifnothasattr(cls, "model"):

cls.model = torch.load("xxx.pt")  # 类级别的模型缓存


18. Python中的函数参数有哪些类型与规则?

五种参数类型

类型
语法
说明
位置参数def func(a, b)
按位置顺序传入
关键字参数func(a=1, b=2)
按参数名传入,可打乱顺序
默认参数def func(a, b=10)
调用时可省略,使用默认值
可变位置参数def func(*args)
接收任意数量的位置参数,打包为元组
可变关键字参数def func(**kwargs)
接收任意数量的关键字参数,打包为字典

参数定义顺序(必须严格遵守)

CODE

位置参数 → 默认参数 → *args → 关键字限定参数 → **kwargs

PYTHON

def example(a, b=2, *args, **kwargs):

print(f"a={a}, b={b}, args={args}, kwargs={kwargs}")

example(1)                        # a=1, b=2, args=(), kwargs={}

example(1, 3, 4, 5, x=10, y=20)  # a=1, b=3, args=(4,5), kwargs={'x':10,'y':20}

默认参数的"陷阱"

默认参数在函数定义时只计算一次,如果默认值是可变对象,可能导致非预期行为:

PYTHON

# ❌ 错误:所有调用共享同一个列表

def add_item(item, lst=[]):

    lst.append(item)

return lst

print(add_item(1))  # [1]

print(add_item(2))  # [1, 2]  不是预期的 [2]!

# ✅ 正确做法

def add_item(item, lst=None):

if lst is None:

        lst = []

    lst.append(item)

return lst


19. Python中*args和**kwargs的使用?

  • *args
    :将不定数量的位置参数打包为元组。
  • kwargs:将不定数量的关键字参数**打包为字典。
PYTHON

# *args 示例

def test_var_args(f_arg, *argv):

print(f"固定参数: {f_arg}")

for arg in argv:

print(f"可变参数: {arg}")

test_var_args('hello', 'python', 'test')

# 固定参数: hello

# 可变参数: python

# 可变参数: test

# **kwargs 示例

def greet_me(**kwargs):

for key, value in kwargs.items():

print(f"{key} == {value}")

greet_me(name="yasoob", age=25)

# name == yasoob

# age == 25

参数解包(反向操作)

PYTHON

def func(a, b, c):

return a + b + c

# 用*解包列表/元组

args = [1, 2, 3]

print(func(*args))  # 6

# 用**解包字典

kwargs = {'a': 1, 'b': 2, 'c': 3}

print(func(**kwargs))  # 6


20. Python中的lambda表达式?

Lambda表达式(匿名函数)是一种创建小型、一次性函数的简洁语法。

PYTHON

# 语法:lambda 参数: 表达式

f = lambda x: x * 2

print(f(3))  # 6

add = lambda x, y: x + y

print(add(2, 3))  # 5

常见使用场景——与高阶函数配合:

PYTHON

sorted 的 key 参数

students = [('Alice', 85), ('Bob', 92), ('Charlie', 78)]

sorted(students, key=lambda s: s[1])  # 按分数排序

map 和 filter

nums = [1, 2, 3, 4, 5]

list(map(lambda x: x**2, nums))       # [1, 4, 9, 16, 25]

list(filter(lambda x: x % 2 == 0, nums))  # [2, 4]

优点:简洁、内联、适合函数式编程风格。

局限:只能包含单个表达式,复杂逻辑应使用 def 定义命名函数。


21. Python中函数传参时会改变参数本身吗?

这取决于参数是可变对象还是不可变对象。Python的传参机制是"传对象引用"(pass-by-object-reference)。

参数类型
函数内修改
外部是否受影响
不可变对象(int, str, tuple等)
重新赋值 → 创建新对象
❌ 不影响
可变对象(list, dict, set等)
原地修改
✅ 影响
PYTHON

# 不可变对象:不受影响

def modify(x):

    x = 10       # 只是让局部变量x指向了新对象

a = 5

modify(a)

print(a)  # 5,不受影响

# 可变对象:受影响

def modify_list(lst):

    lst.append(3)  # 原地修改

my_list = [1, 2]

modify_list(my_list)

print(my_list)  # [1, 2, 3],已被修改

# 如何避免?传入拷贝

import copy

original = [1, 2]

modify_list(copy.deepcopy(original))

print(original)  # [1, 2] 保持不变


22. Python中海象运算符(:=)介绍

海象运算符 :=(Python 3.8+引入)允许在表达式内部进行赋值,减少重复计算。

PYTHON

# 传统写法:需要先赋值再判断

n = len(data)

if n > 10:

print(f"列表太长,有{n}个元素")

# 海象运算符:在表达式中直接赋值

if (n := len(data)) > 10:

print(f"列表太长,有{n}个元素")

# 循环中读取文件

while (line := file.readline()) != '':

    process(line)

# 列表推导中避免重复计算

results = [y for x in data if (y := expensive_func(x)) > 0]

注意事项:海象运算符不能替代普通的 = 赋值,只在表达式上下文中使用。


四、Python高级特性

23. Python中迭代器的概念?

可迭代对象(Iterable):实现了 __iter__ 方法的对象,可以被 for 循环遍历(如 listtupledictsetstr)。

迭代器(Iterator):同时实现了 __iter__ 和 __next__ 方法的对象。__iter__ 返回自身,__next__ 返回下一个元素,耗尽时抛出 StopIteration

PYTHON

from collections.abc import Iterable, Iterator

# 判断是否可迭代

print(isinstance([1, 2, 3], Iterable))  # True

print(isinstance(123, Iterable))        # False

# 将可迭代对象转为迭代器

lst = [1, 2, 3]

it = iter(lst)

print(type(it))      # <class 'list_iterator'>

print(next(it))      # 1

print(next(it))      # 2

print(next(it))      # 3

print(next(it))    # StopIteration!

for循环的本质

PYTHON

# for循环底层等价于:

it = iter(iterable)

whileTrue:

try:

        item = next(it)

except StopIteration:

break

    # 处理 item

迭代器的优势:惰性求值(lazy evaluation),只在调用 next() 时才计算下一个值,可以处理超大数据集而不一次性加载到内存。


24. Python中生成器的相关知识

生成器(Generator)是一种特殊的迭代器,用更简洁的方式创建。

两种创建方式

方式一:生成器表达式

PYTHON

# 将列表推导的 [] 换成 ()

gen = (x * x for x inrange(10))

print(gen)           # <generator object <genexpr> at 0x...>

print(next(gen))     # 0

print(next(gen))     # 1

方式二:yield 函数

PYTHON

def spam():

yield "first"

yield "second"

yield "third"

for x in spam():

print(x)    # first → second → third

yield 的特性:

  • 执行到 yield 时暂停并返回值,保留函数状态
  • 下次调用 next() 时从暂停处继续执行
  • 函数执行完毕时自动抛出 StopIteration

生成器的高级用法

PYTHON

# send():向生成器发送值

def accumulator():

    total = 0

whileTrue:

        value = yield total

if value is None:

break

        total += value

acc = accumulator()

print(next(acc))      # 0(启动生成器)

print(acc.send(10))   # 10

print(acc.send(20))   # 30

# close():关闭生成器

acc.close()

生成器是实现协程(coroutine)的基础,也是Python异步编程的核心机制之一。


25. Python中装饰器的相关知识

装饰器(Decorator)是一种在不修改原函数代码的前提下为函数添加额外功能的设计模式,本质是一个接受函数作为参数并返回新函数的高阶函数。

基本装饰器

PYTHON

import logging

def use_log(func):

    """装饰器:在函数执行前记录日志"""

def wrapper(*args, **kwargs):

        logging.warning(f'{func.__name__} is running')

return func(*args, **kwargs)

return wrapper

@use_log        # 等价于 bar = use_log(bar)

def bar():

print('I am bar')

bar()

# WARNING:root:bar is running

# I am bar

带参数的装饰器(三层嵌套)

PYTHON

def repeat(n):

    """让函数重复执行n次"""

def decorator(func):

def wrapper(*args, **kwargs):

for _ inrange(n):

                result = func(*args, **kwargs)

return result

return wrapper

return decorator

@repeat(3)

def say_hello():

print("Hello!")

say_hello()  # 打印3次 Hello!

保留函数元信息

使用 functools.wraps 保留原函数的 __name____doc__ 等元信息:

PYTHON

from functools import wraps

def my_decorator(func):

@wraps(func)

def wrapper(*args, **kwargs):

return func(*args, **kwargs)

return wrapper


26. 什么是Python中的魔术方法?

魔术方法(Magic Methods)是以双下划线 __ 开头和结尾的特殊方法,让自定义类可以与Python内置操作无缝集成。

常用魔术方法速览

类别
方法
触发方式
构造/表示__init__obj = MyClass()
__str__str(obj)
print(obj)
__repr__repr(obj)
, 交互式环境直接输入obj
运算符__add__obj1 + obj2
__sub__obj1 - obj2
__mul__obj1 * obj2
__truediv__obj1 / obj2
比较__eq__obj1 == obj2
__lt__obj1 < obj2
__gt__obj1 > obj2
容器__len__len(obj)
__getitem__obj[key]
__setitem__obj[key] = value
迭代__iter__iter(obj)
__next__next(obj)
可调用__call__obj()

运算符重载示例

PYTHON

class Vector:

def __init__(self, x, y):

self.x = x

self.y = y

def __add__(self, other):

return Vector(self.x + other.x, self.y + other.y)

def __repr__(self):

return f"Vector({self.x}, {self.y})"

v1 = Vector(1, 2)

v2 = Vector(3, 4)

print(v1 + v2)  # Vector(4, 6)


27. Python中match-case语句(Python 3.10+)

Python 3.10引入的 match-case 是结构化模式匹配(Structural Pattern Matching),比传统的 switch-case 更强大。

基本模式

PYTHON

# 1. 常量匹配

def describe(x):

    match x:

        case 0:

return "零"

        case 1:

return "一"

        case _:         # _ 是通配符,匹配任何值

return "其他"

# 2. 变量绑定

match x:

    case 0:

print("零")

    case n:             # n 捕获值(因为是在 case 中首次出现)

print(f"值是 {n}")

# 3. 序列匹配

def process_point(point):

    match point:

        case (0, 0):

print("原点")

        case (x, 0):

print(f"在x轴上,x={x}")

        case (0, y):

print(f"在y轴上,y={y}")

        case (x, y):

print(f"坐标({x}, {y})")

process_point((3, 0))   # 在x轴上,x=3

类模式匹配

PYTHON

class Point:

def __init__(self, x, y):

self.x = x

self.y = y

p = Point(1, 2)

match p:

    case Point(x=0, y=0):

print("原点")

    case Point(x=x, y=0):

print(f"在x轴上,x={x}")

    case Point(x=0, y=y):

print(f"在y轴上,y={y}")

    case Point(x=x, y=y):

print(f"坐标({x}, {y})")

守卫条件(Guard)

PYTHON

match value:

    case n if n < 0:

print("负数")

    case n if n == 0:

print("零")

    case n if n > 0:

print("正数")

注意match-case 不会"穿透"(fall-through),匹配成功即退出。Python不支持 case 0..10: 这样的区间语法,应使用守卫条件 case n if 0 <= n <= 10: 实现区间匹配。


28. Python中eval函数的作用?

eval(source, /, globals=None, locals=None) 将字符串作为Python表达式执行并返回结果。

PYTHON

x = 7

print(eval('3 * x'))       # 21

print(eval('2 + 2'))       # 4

# 字符串转数据类型

num = eval("42")

print(type(num))  # <class 'int'>

# 可以指定命名空间

print(eval('x + 1', {'x': 10}))  # 11(在指定的globals中执行)

⚠️ 安全警告

  • eval()
    会执行任意Python代码,如果传入的字符串来自不可信来源(如用户输入),可能导致代码注入攻击。
  • 永远不要对用户输入使用 eval()
  • 如果只是需要安全地解析简单数据(如JSON数字),使用 int()float()ast.literal_eval() 等更安全的替代方案。

29. Python中的字符串格式化技术

Python有三种字符串格式化方式:

1. f-string(Python 3.6+,推荐)

PYTHON

name = "Alice"

age = 30

print(f"Name: {name}, Age: {age}")         # Name: Alice, Age: 30

print(f"Pi: {3.14159:.2f}")                # Pi: 3.14

print(f"{age=}")                            # age=30(调试模式,Python 3.8+)

2. str.format() 方法

PYTHON

print("Name: {}, Age: {}".format(name, age))           # 按位置

print("Name: {0}, Age: {1}".format(name, age))         # 按索引

print("Name: {n}, Age: {a}".format(n=name, a=age))     # 按名称

print("Pi: {:.2f}".format(3.14159))                    # Pi: 3.14

3. 百分号(%)格式化(旧式)

PYTHON

print("Name: %s, Age: %d" % (name, age))    # Name: Alice, Age: 30

print("Pi: %.2f" % 3.14159)                 # Pi: 3.14

推荐优先级:f-string > str.format() > %格式化。f-string 最简洁、可读性最好且性能最高。


30. Python中文件有哪些打开模式?

PYTHON

# 基本语法

with open('file.txt', mode='r', encoding='utf-8') as f:

    content = f.read()

模式
说明
'r'
只读(默认),文件必须存在
'w'
写入,文件存在则清空,不存在则创建
'a'
追加写入,文件不存在则创建
'x'
独占创建,文件已存在则抛出 FileExistsError
't'
文本模式(默认),读写 str,自动处理换行符
'b'
二进制模式,读写 bytes,用于图片/音频等
'+'
读写模式(与以上组合):'r+''w+''a+'

组合示例

PYTHON

# 读取文本文件

with open('data.txt', 'r', encoding='utf-8') as f:

    text = f.read()

# 写入二进制文件(如图像处理中间结果)

with open('output.bin', 'wb') as f:

    f.write(b'\x00\x01\x02')

# 逐行读取

with open('large_file.txt', 'r') as f:

for line in f:         # 迭代器,不会一次性加载全部

        process(line)

最佳实践:始终使用 with 语句确保文件自动关闭。


算法岗校招面试系列目前规划10+ 章 50+ 篇内容,涵盖 Python、C/C++、计网、数据结构、数字图像、机器学习、深度学习、大模型、Agent、算法题等所有算法岗面试核心模块。关注本号,第一时间收到更新。

校招算法岗求职干货合集 · 第1章 编程基础:Python整理版共67个问答,本文为第 2/5 篇

📮 下期预告

下一篇:内存管理与并发编程

深拷贝浅拷贝 · 垃圾回收 · 循环引用 · 内存泄漏 · GIL · 多进程 · 线程池

共 17 个问答,明天见。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 10:52:14 HTTP/2.0 GET : https://f.mffb.com.cn/a/501292.html
  2. 运行时间 : 0.094220s [ 吞吐率:10.61req/s ] 内存消耗:4,827.59kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=b675c76cc9b359d6cd9763f2c9db6acf
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000545s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000782s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000343s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000279s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000512s ]
  6. SELECT * FROM `set` [ RunTime:0.000195s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000535s ]
  8. SELECT * FROM `article` WHERE `id` = 501292 LIMIT 1 [ RunTime:0.000559s ]
  9. UPDATE `article` SET `lasttime` = 1783047135 WHERE `id` = 501292 [ RunTime:0.018840s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000369s ]
  11. SELECT * FROM `article` WHERE `id` < 501292 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000525s ]
  12. SELECT * FROM `article` WHERE `id` > 501292 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000597s ]
  13. SELECT * FROM `article` WHERE `id` < 501292 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.000834s ]
  14. SELECT * FROM `article` WHERE `id` < 501292 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000913s ]
  15. SELECT * FROM `article` WHERE `id` < 501292 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001033s ]
0.095770s