<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>灵心小窝</title>
        <link>https://blog.mcpq.cc/</link>
        <description>
这里不是一个喧闹的地方，只是用来存放一些还不想遗忘的东西。</description>
        <lastBuildDate>Fri, 06 Mar 2026 15:54:44 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>zh-CN</language>
        <copyright>All rights reserved 2026, 早清风</copyright>
        <item>
            <title><![CDATA[免费使用Codex教程]]></title>
            <link>https://blog.mcpq.cc/article/free-codex</link>
            <guid>https://blog.mcpq.cc/article/free-codex</guid>
            <pubDate>Fri, 06 Mar 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[这是一篇免费使用 Codex  3的教程，需先配置上网代理工具并设置 Socks 端口，将脚本端口与代理保持一致；再准备 Python 环境，创建虚拟环境后运行注册脚本，网络需符合 OpenAI 支持地区，成功后生成包含 token 的 JSON 认证文件；接着部署支持多账号轮询的开源代理面板（推荐 Docker 部署），上传 JSON 文件并创建密钥，通过面板地址 + 密钥即可调用，除一个需要而外身份验证的模型外，其余模型均可正常使用。]]></description>
            <content:encoded><![CDATA[这是一篇免费使用 Codex  3的教程，需先配置上网代理工具并设置 Socks 端口，将脚本端口与代理保持一致；再准备 Python 环境，创建虚拟环境后运行注册脚本，网络需符合 OpenAI 支持地区，成功后生成包含 token 的 JSON 认证文件；接着部署支持多账号轮询的开源代理面板（推荐 Docker 部署），上传 JSON 文件并创建密钥，通过面板地址 + 密钥即可调用，除一个需要而外身份验证的模型外，其余模型均可正常使用。]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[废柴召唤师的史莱姆超凶-第1章 召唤]]></title>
            <link>https://blog.mcpq.cc/article/tiancai-zhaohuanshi-de-shilaimu-chaoxiong-di1zhang-zhaohuan</link>
            <guid>https://blog.mcpq.cc/article/tiancai-zhaohuanshi-de-shilaimu-chaoxiong-di1zhang-zhaohuan</guid>
            <pubDate>Sat, 28 Feb 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[魔法学院一年一度的召唤仪式上，没落召唤师风语家族的少女艾莉娅，当众被天才法师维克多羞辱——在他眼里，召唤系不过是只能召唤史莱姆的“废物魔法”。没人知道，这只F级史莱姆体内，藏着一个穿越者的灵魂——林墨。滴,系统激活.]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-3135ea8e53e380b7a88ad114a9ccaa75"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><div class="notion-text notion-block-3155ea8e53e3807eb6b6ef087d0febba">魔法学院广场上人声鼎沸。</div><div class="notion-text notion-block-3155ea8e53e38016a7e5c8b1b2209f89">今天是学院一年一度的召唤仪式，所有年满十八岁的学生都可以在这一天尝试召唤属于自己的魔物。</div><div class="notion-text notion-block-3155ea8e53e3801ebd55f23bb5f0ca7b">广场中央，一座巨大的召唤阵散发着淡淡的魔力光芒。周围挤满了来看热闹的学生，他们议论纷纷，期待着今年会不会出现什么天才召唤师。</div><blockquote class="notion-quote notion-block-3155ea8e53e380db9d95cabfc221145d"><div>“下一个，艾莉娅·风语！”</div></blockquote><div class="notion-text notion-block-3155ea8e53e380e7bea6e83e09245c87">随着导师的喊声，人群自动分开一条道路。</div><div class="notion-text notion-block-3155ea8e53e380648dd6c7446675e797">一个娇小的身影从人群中走了出来。</div><div class="notion-text notion-block-3155ea8e53e380a8ad33c7f2bc5aa843">她有着银灰色的长发，扎成了双马尾。碧绿色的眼睛大而明亮，圆圆的脸蛋带着婴儿肥，看起来甜美又无害。</div><div class="notion-text notion-block-3155ea8e53e38052a5a2c890fdd94089">只是她身上那件召唤师袍略显陈旧，领口的风语家族纹章已经褪了色。</div><hr class="notion-hr notion-block-3155ea8e53e3801892a7dd6614e310ec"/><blockquote class="notion-quote notion-block-3155ea8e53e3804589ebfcfbb949c85f"><div>“风语家族？那个没落了的召唤师家族？”</div><div class="notion-text notion-block-3155ea8e53e38032a6fed37ff9eb8f5d">“听说她父母都死了，现在寄养在远房亲戚家。”</div><div class="notion-text notion-block-3155ea8e53e380ca95b7c0ace82bf67c">“可怜，召唤系早就没落了，她还坚持什么？”</div></blockquote><div class="notion-text notion-block-3155ea8e53e38020814acf5a55b3464c">窃窃私语声传入艾莉娅的耳中，但她仿佛没有听见一般，只是紧紧地攥着拳头，一步一步走向召唤阵。</div><blockquote class="notion-quote notion-block-3155ea8e53e3808bb4d0fc7bcd687562"><div>“哟，这不是艾莉娅吗？”</div></blockquote><div class="notion-text notion-block-3155ea8e53e38053ad5bf39b0d74fd4d">一个带着嘲讽的声音响起。</div><div class="notion-text notion-block-3155ea8e53e38063ba1dcc40ae13c359">红发的青年从人群中走出，他穿着华丽的火红色法师袍，胸前别着元素法师塔的徽章。俊朗的面容上挂着轻蔑的笑容。</div><div class="notion-text notion-block-3155ea8e53e3807b83c5c0ed3661b79a"><b>维克多·雷恩</b>，元素法师塔的天才，学院里最耀眼的存在之一。</div><blockquote class="notion-quote notion-block-3155ea8e53e380919284c4bb37778391"><div>“维克多学长...”艾莉娅停下脚步，小声打了个招呼。</div></blockquote><blockquote class="notion-quote notion-block-3155ea8e53e380698fe1f62bb8bffa7e"><div>“召唤系？”维克多嗤笑一声，“那种只能召唤史莱姆的废物魔法？”</div></blockquote><div class="notion-text notion-block-3155ea8e53e380f3bb11f6b39fcfdc6e">他走近一步，居高临下地看着艾莉娅：</div><blockquote class="notion-quote notion-block-3155ea8e53e380268957cd5315edf430"><div>“我叔叔是元素法师塔的长老，他最讨厌的就是你们这些召唤师。整天搞些没用的契约，浪费魔力。”</div></blockquote><div class="notion-text notion-block-3155ea8e53e380bd8d71da455065ee45">艾莉娅的脸涨得通红，但她没有退缩，而是抬起头，倔强地看着维克多：</div><blockquote class="notion-quote notion-block-3155ea8e53e3806ebb20eef4e823a906"><div>“召唤系不是废物魔法！我的祖先曾经是大陆上最强的召唤师！”</div></blockquote><blockquote class="notion-quote notion-block-3155ea8e53e380ddab75d778eb3151de"><div>“最强？”维克多像是听到了什么笑话，“那是千年前的事了。现在的召唤系，连给元素法师塔提鞋都不配。”</div></blockquote><div class="notion-text notion-block-3155ea8e53e380d4b618ffb9b87bb798">他扫了一眼艾莉娅陈旧的召唤师袍，眼中闪过一丝不屑：</div><blockquote class="notion-quote notion-block-3155ea8e53e380ae94b4e9a65b25f9fe"><div>“风语家族？早就没落了。你就算召唤出什么好东西，也改变不了召唤系是废物的事实。”</div></blockquote><blockquote class="notion-quote notion-block-3155ea8e53e3801495efc16307358d6a"><div>“我...”艾莉娅咬着嘴唇，眼眶有些发红。</div></blockquote><blockquote class="notion-quote notion-block-3155ea8e53e380029c45e5d57f15e107"><div>“够了，维克多。”导师皱着眉头打断，“让艾莉娅进行召唤仪式。”</div></blockquote><div class="notion-text notion-block-3155ea8e53e38085a14cd22dd6e75b4a">维克多耸耸肩，退到一旁，但眼中的嘲讽之色更浓了：</div><blockquote class="notion-quote notion-block-3155ea8e53e38068a1abca2e8d89a2be"><div>“好啊，让我看看，风语家族的最后血脉，能召唤出什么‘强大’的魔物。”</div></blockquote><hr class="notion-hr notion-block-3155ea8e53e380ae857bcd3123d2aea9"/><div class="notion-text notion-block-3155ea8e53e3800d8d10fb8f2dcf4740">艾莉娅深吸一口气，走向召唤阵。</div><div class="notion-text notion-block-3155ea8e53e3806cbe18de113d55c396">她站在召唤阵中央，闭上眼睛，开始吟唱召唤咒语。</div><blockquote class="notion-quote notion-block-3155ea8e53e380f180a4e9d4446e0175"><div>“以风语之名，以血脉为引，跨越虚空，回应我的呼唤——”</div></blockquote><div class="notion-text notion-block-3155ea8e53e38089b556e143f61c9ebd">随着她的吟唱，召唤阵开始亮起光芒。</div><div class="notion-text notion-block-3155ea8e53e38001aff6f41f8d77e4b1">只是……这光芒有些奇怪。</div><div class="notion-text notion-block-3155ea8e53e38015bb4af11407ad273c">正常的召唤阵应该亮起白色或金色的光芒，但艾莉娅的召唤阵，却亮起了淡蓝色的光芒，像是深海中的幽光，神秘而古老。</div><blockquote class="notion-quote notion-block-3155ea8e53e38024a91dc79403478671"><div>“嗯？”维克多皱起眉头。</div></blockquote><div class="notion-text notion-block-3155ea8e53e380f78f0cde0ffbaaa42c">导师也露出了惊讶的表情：</div><blockquote class="notion-quote notion-block-3155ea8e53e380259af2d5e621a03418"><div>“这种光芒……从来没见过……”</div></blockquote><div class="notion-text notion-block-3155ea8e53e3805695a0c399905ac8ec">角落里，一个戴着兜帽的老者微微抬头，浑浊的眼中闪过一丝精光。</div><div class="notion-text notion-block-3155ea8e53e380129081ebb0580ba674">召唤阵的光芒越来越盛。</div><div class="notion-text notion-block-3155ea8e53e380ea8606c440292db040">所有人都屏住了呼吸。</div><div class="notion-text notion-block-3155ea8e53e3800fb69feeb8c1aba3a4">然后——</div><blockquote class="notion-quote notion-block-3155ea8e53e380669577f587fab642ba"><div>“噗叽。”</div></blockquote><div class="notion-text notion-block-3155ea8e53e38016be16fe877f2f95be">一团半透明的东西从召唤阵中“弹”了出来。</div><div class="notion-text notion-block-3155ea8e53e3809e8028c1de8da8215a">它大概拳头大小，呈淡蓝色，像是一团……果冻？</div><div class="notion-text notion-block-3155ea8e53e3803f93b9ffe9d3086a47">Q弹的身体在地上弹了两下，然后停了下来，微微颤动。</div><hr class="notion-hr notion-block-3155ea8e53e380f990b9d6cf92c40ab4"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3155ea8e53e3802396ddc600408b8955" data-id="3155ea8e53e3802396ddc600408b8955"><span><div id="3155ea8e53e3802396ddc600408b8955" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3155ea8e53e3802396ddc600408b8955" title="系统提示"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">系统提示</span></span></h3><hr class="notion-hr notion-block-3155ea8e53e380c9811be1d7246c1632"/><div class="notion-text notion-block-3155ea8e53e38055b6ddfea5948f544f">林墨最后的记忆是通宵打游戏，眼前一黑……</div><div class="notion-text notion-block-3155ea8e53e380e397d1fc0d54dff291">再醒来，就变成了这么一团……史莱姆？</div><div class="notion-text notion-block-3155ea8e53e3803ca7d9e8a79c6d16cd">“我穿越了？”</div><div class="notion-text notion-block-3155ea8e53e380e198a4c4b3a24e98b2">他在心中吐槽，但发出来的声音却是：</div><blockquote class="notion-quote notion-block-3155ea8e53e38010a695e96f90230385"><div>“噗叽~”</div></blockquote><div class="notion-text notion-block-3155ea8e53e380d19f8acf0571436c51">与此同时，信息涌入他的意识。</div><div class="notion-text notion-block-3155ea8e53e380788d94fce7e625a2b4">穿越者。吞噬者幼体。最强进化系统。</div><div class="notion-text notion-block-3155ea8e53e380f38f37c83e93db80ec">以及……</div><div class="notion-text notion-block-3155ea8e53e3800a81cac3c30f90e3de">他感知到了抱着他的那个少女。</div><div class="notion-text notion-block-3155ea8e53e380a7985ecc13c63ece05"><b>艾莉娅·风语。</b></div><div class="notion-text notion-block-3155ea8e53e380dfb827e50d17ccbbee">她的魔力……好浓郁，像是被什么东西封印着。</div><div class="notion-text notion-block-3155ea8e53e38067afa1eba39d2375ce">这丫头，不简单。</div><hr class="notion-hr notion-block-3155ea8e53e38010b3c2eca91385dbe0"/><div class="notion-text notion-block-3155ea8e53e380e9acbfc098be2b9a60">全场寂静。</div><div class="notion-text notion-block-3155ea8e53e380f78e30d83ce090673f">一秒。</div><div class="notion-text notion-block-3155ea8e53e380d1bf71e6bd5ef992f2">两秒。</div><div class="notion-text notion-block-3155ea8e53e3803886e6c672f43a375b">三秒。</div><blockquote class="notion-quote notion-block-3155ea8e53e3807195e0e3980ad835d2"><div>“哈哈哈哈哈哈哈！”</div></blockquote><div class="notion-text notion-block-3155ea8e53e3802ca32beb4f50795967">爆笑声响彻整个广场。</div><blockquote class="notion-quote notion-block-3155ea8e53e380649266e9df234497ba"><div>“史莱姆！真的是史莱姆！”</div><div class="notion-text notion-block-3155ea8e53e38028856ce973fdab8317">“最废物的F级召唤物！”</div><div class="notion-text notion-block-3155ea8e53e3801ea3f4cbf427b090e2">“笑死我了，我还以为会有什么惊喜，结果真的是废物魔法！”</div></blockquote><div class="notion-text notion-block-3155ea8e53e3801a9cb6d5e07c37ea9c">维克多笑得前仰后合，眼泪都出来了：</div><blockquote class="notion-quote notion-block-3155ea8e53e380558802dc1100c643eb"><div>“艾莉娅，你……你真是太让我‘惊喜’了！居然真的召唤出了史莱姆！还是最普通的F级史莱姆！”</div></blockquote><div class="notion-text notion-block-3155ea8e53e38016b0facaa963255092">艾莉娅呆呆地看着地上的那团淡蓝色胶状物，脸色苍白。</div><div class="notion-text notion-block-3155ea8e53e3803b8dd1ca3a41c27b25">真的是……史莱姆？</div><div class="notion-text notion-block-3155ea8e53e3803699d4db5038e4b47f">她努力了这么多年，每天刻苦修炼，就是为了在召唤仪式上证明自己……</div><div class="notion-text notion-block-3155ea8e53e38068a490e76d0e92b559">结果，召唤出了最废物的史莱姆？</div><div class="notion-text notion-block-3155ea8e53e38013b423efafc231707e">眼泪在眼眶中打转，但她强忍着不让它流下来。</div><div class="notion-text notion-block-3155ea8e53e38064bf61c4148086f43b">风语家族的人……从不退缩……</div><div class="notion-text notion-block-3155ea8e53e380b5910af1e032130c92">她蹲下身，颤抖着伸出手，想要触碰那团史莱姆——</div><div class="notion-text notion-block-3155ea8e53e380fe9723fa9cecf20593">就在这时，那团史莱姆突然动了一下。</div><div class="notion-text notion-block-3155ea8e53e3802b8ee8d766f3d918c4">艾莉娅的手指碰到了它的表面。</div><div class="notion-text notion-block-3155ea8e53e380c99094cbdf086aeedd">软软的。</div><div class="notion-text notion-block-3155ea8e53e38074b98be5f738335472">凉凉的。</div><div class="notion-text notion-block-3155ea8e53e380668fabceebcaa8a05d">像是……果冻一样。</div><div class="notion-text notion-block-3155ea8e53e38025b907c24324ce30bb">而且，不知道为什么，在触碰到它的瞬间，艾莉娅感觉到一股温暖的力量从指尖传来，让她原本沮丧的心情莫名地好了一些。</div><div class="notion-text notion-block-3155ea8e53e380b5a7a8efafa88816ec">她双手捧起那团史莱姆，眼睛一点一点亮了起来。</div><div class="notion-text notion-block-3155ea8e53e380b69df9fb11047e970c">维克多看着她的表情，笑声戛然而止：</div><blockquote class="notion-quote notion-block-3155ea8e53e3802cbd9ed67e007afa96"><div>“你……”</div></blockquote><div class="notion-text notion-block-3155ea8e53e380669ad3c946553981a4">艾莉娅没有理他。</div><div class="notion-text notion-block-3155ea8e53e380fba439f36ab545536c">她把史莱姆抱进怀里，用脸蛋蹭了蹭它Q弹的身体，嘴角弯起一个甜甜的弧度。</div><div class="notion-text notion-block-3155ea8e53e3803d9da0f02ab9710671">然后她捧着史莱姆转了个圈，双马尾在空中划出欢快的弧线。</div><div class="notion-text notion-block-3155ea8e53e380e5874fd2f90eab5435">全场再次寂静。</div><div class="notion-text notion-block-3155ea8e53e380cf8539d02e1c76dcd7">所有人都用看傻子的眼神看着艾莉娅。</div><div class="notion-text notion-block-3155ea8e53e38080b929fd197edeb7d9">这丫头……脑子有问题吧？</div><div class="notion-text notion-block-3155ea8e53e380be8e2be50b890e3d81">维克多嘴角抽搐：</div><blockquote class="notion-quote notion-block-3155ea8e53e380fa96bad629486d6f74"><div>“艾莉娅，你……”</div></blockquote><blockquote class="notion-quote notion-block-3155ea8e53e3800db623e7a68876f12f"><div>“以后你就是我的伙伴了！”艾莉娅完全沉浸在喜悦中，声音清脆，“我叫你墨墨好不好？”</div></blockquote><blockquote class="notion-quote notion-block-3155ea8e53e380c1a3e3d594e0f25591"><div>“墨墨？”维克多一脸懵逼，“什么娘们唧唧的名字？”</div></blockquote><blockquote class="notion-quote notion-block-3155ea8e53e380e19cf7fc5b1d975179"><div>“因为……”艾莉娅歪着头想了想，“你看起来像是墨色的，但又亮晶晶的，而且软软的，所以叫墨墨！”</div></blockquote><div class="notion-text notion-block-3155ea8e53e380808e59e6aa99b06a24">她说着，又蹭了蹭史莱姆，眼睛弯成了月牙。</div><div class="notion-text notion-block-3155ea8e53e380258359cd611247c00a">史莱姆内部，林墨叹了口气。</div><div class="notion-text notion-block-3155ea8e53e3807a99f8c1988e7cfffd">“墨墨……算了，你开心就好。”</div><div class="notion-text notion-block-3155ea8e53e38025ae5ac84a5c780f09">他在心中默默接受了这个娘里娘气的昵称。</div><blockquote class="notion-quote notion-block-3155ea8e53e3807bb231c7474fb3f01e"><div>“……”</div></blockquote><div class="notion-text notion-block-3155ea8e53e3802a8c29ca9e8c07e687">全场无语。</div><div class="notion-text notion-block-3155ea8e53e38084ae44eb3578fecb32">这丫头是真的傻吧？</div><div class="notion-text notion-block-3155ea8e53e38092ac99f57bb72ec6b5">然而，没有人注意到，被艾莉娅捧在手心的那团史莱姆，内部闪过一丝金色的光芒。</div><div class="notion-text notion-block-3155ea8e53e380e9a0dddca406db55cd">角落里，兜帽老者深深看了艾莉娅一眼，悄然离去。</div><hr class="notion-hr notion-block-3155ea8e53e380e1afa1c1676450ba67"/><blockquote class="notion-quote notion-block-3155ea8e53e380e4a795d28bd8d26891"><div>“墨墨，我们回家吧！”艾莉娅开心地说，完全无视了周围的嘲笑声。</div></blockquote><div class="notion-text notion-block-3155ea8e53e380d7aa85dba4fd917508">她抱着墨墨，蹦蹦跳跳地离开了广场。</div><div class="notion-text notion-block-3155ea8e53e3802bbe07df526acc83e1">维克多看着她的背影，冷笑一声：</div><blockquote class="notion-quote notion-block-3155ea8e53e380089210efbdd171aec8"><div>“哼，召唤出史莱姆还这么开心，真是废物配废物。”</div></blockquote><div class="notion-text notion-block-3155ea8e53e380a38755cff495f9e4fb">他转身离开，完全没有注意到，艾莉娅怀中的那团史莱姆，内部闪过一丝危险的金色光芒。</div><hr class="notion-hr notion-block-3155ea8e53e38063b368e258e3b372b8"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-3155ea8e53e380f690a9ee717df33132" data-id="3155ea8e53e380f690a9ee717df33132"><span><div id="3155ea8e53e380f690a9ee717df33132" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3155ea8e53e380f690a9ee717df33132" title="夜幕降临"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">夜幕降临</span></span></h3><div class="notion-text notion-block-3155ea8e53e38029b12cc541c498690b">艾莉娅的出租屋里。</div><div class="notion-text notion-block-3155ea8e53e38073a889e097e578574c">她盘腿坐在床上，双手捧着墨墨，认真地说：</div><blockquote class="notion-quote notion-block-3155ea8e53e380238577cab41965e295"><div>“墨墨，从今天起，我们就是家人了！”</div></blockquote><blockquote class="notion-quote notion-block-3155ea8e53e38047b05ad7f65237e8b6"><div>“我会努力变强的！一定会让所有人都知道，召唤系不是废物魔法！”</div></blockquote><blockquote class="notion-quote notion-block-3155ea8e53e3802aa9e2dc7eb6c89f85"><div>“还有……”她低下头，声音有些哽咽，“谢谢你选择了我……”</div></blockquote><div class="notion-text notion-block-3155ea8e53e38031bb7edbd9a8fce7b4">林墨看着她泛红的眼眶，心中某个柔软的地方被触动了。</div><div class="notion-text notion-block-3155ea8e53e380a0a659ef779f56ed1f">这丫头……明明被那么多人嘲笑，却还在感谢他？</div><div class="notion-text notion-block-3155ea8e53e3806cb8f2c15fdd5ff3ef">林墨感知着艾莉娅体内那股被封印的庞大魔力。</div><div class="notion-text notion-block-3155ea8e53e380078446ce5ad6b06f79">这股力量……如果完全觉醒，恐怕会让整个世界震惊。</div><div class="notion-text notion-block-3155ea8e53e380eea45ad088698539ba">“算了，既然你把我当家人……那我就保护你吧。”</div><div class="notion-text notion-block-3155ea8e53e380c48831e5a24eabc056">艾莉娅突然感觉到，怀中的史莱姆似乎变得温暖了一些。</div><blockquote class="notion-quote notion-block-3155ea8e53e3808586f8edc21693332f"><div>“墨墨？”她疑惑地眨眨眼。</div></blockquote><div class="notion-text notion-block-3155ea8e53e380688181f56662c95199">史莱姆微微颤动，像是在回应她。</div><div class="notion-text notion-block-3155ea8e53e380458219f55bff626c56">艾莉娅开心地笑了，抱着墨墨躺到床上，用脸蛋蹭了蹭他软软的身体。</div><blockquote class="notion-quote notion-block-3155ea8e53e38022932eed27ad146489"><div>“晚安，墨墨~”</div><div class="notion-text notion-block-3155ea8e53e3808b9ea9e4e787a46e10">“明天开始，我们要一起加油哦！”</div></blockquote><div class="notion-text notion-block-3155ea8e53e380b792c5cfd39efcc2d4">林墨（墨墨）：“……晚安。”</div><div class="notion-text notion-block-3155ea8e53e380a18ecbdf4cc455c2f1">他在心中默默回应。</div><div class="notion-text notion-block-3155ea8e53e3804aab1ce70ead656f48">虽然发出来的声音依然是：</div><blockquote class="notion-quote notion-block-3155ea8e53e380a9abaed1b2614e5511"><div>“噗叽~”</div></blockquote><hr class="notion-hr notion-block-3155ea8e53e380768c81f538625778f1"/><div class="notion-text notion-block-3155ea8e53e3805b9782e2cdd7341105">窗外，月光洒进来，照在相拥而眠的少女和史莱姆身上。</div><div class="notion-text notion-block-3155ea8e53e380458cf3f230656219fb">一个关于隐藏大佬和单纯召唤师的故事，就此开始。</div><hr class="notion-hr notion-block-3155ea8e53e380178063dd82cfe359f5"/><div class="notion-text notion-block-3155ea8e53e38022ba2ff30da62b40c9"><b>                                                                                                                                                                （第1章 完）</b></div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2026年2月26日随想]]></title>
            <link>https://blog.mcpq.cc/article/2026-02-22-reflections</link>
            <guid>https://blog.mcpq.cc/article/2026-02-22-reflections</guid>
            <pubDate>Thu, 26 Feb 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[又一个不眠之夜]]></description>
            <content:encoded><![CDATA[又一个不眠之夜]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[三、实例方法学习笔记]]></title>
            <link>https://blog.mcpq.cc/article/python-instance-method-learning-notes-3</link>
            <guid>https://blog.mcpq.cc/article/python-instance-method-learning-notes-3</guid>
            <pubDate>Sat, 21 Feb 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[self 就像是每个对象的身份证——方法需要通过它来知道"我在操作哪个对象"！]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-30e5ea8e53e38031a9a5f97431e92e53"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><blockquote class="notion-quote notion-block-30e5ea8e53e3801da9bad1bfbb5a9ce6"><div>💡 <b>学习感悟</b>：<code class="notion-inline-code">self</code> 就像是<b>每个对象的身份证</b>——方法需要通过它来知道&quot;我在操作哪个对象&quot;！</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e3800e9c8de7f295ef99c8"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e380109cedf16ad3d3bb59" data-id="30e5ea8e53e380109cedf16ad3d3bb59"><span><div id="30e5ea8e53e380109cedf16ad3d3bb59" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380109cedf16ad3d3bb59" title="1. 什么是实例方法？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1. 什么是实例方法？</span></span></h3><div class="notion-text notion-block-30e5ea8e53e3801da7d2f0f552a8d967"><b>实例方法</b>是绑定到对象的方法，第一个参数必须是 <code class="notion-inline-code">self</code>，表示实例自身。</div><blockquote class="notion-quote notion-block-30e5ea8e53e380969a49e9ca98cdf1b6"><div>📝 <b>我的理解</b>：实例方法就像是<b>对象的技能</b>——每个学生（对象）都会学习（方法），但学的是自己的内容。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e38085bfbcd4fc3109aaa2"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e380fdb86fc615a864b184" data-id="30e5ea8e53e380fdb86fc615a864b184"><span><div id="30e5ea8e53e380fdb86fc615a864b184" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380fdb86fc615a864b184" title="2. self 参数详解"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2. self 参数详解</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380068f97ffd31cf298e9" data-id="30e5ea8e53e380068f97ffd31cf298e9"><span><div id="30e5ea8e53e380068f97ffd31cf298e9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380068f97ffd31cf298e9" title="2.1 self 是什么？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.1 self 是什么？</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e380fb978bc82952027270"><div>📝 <b>我的理解</b>：<code class="notion-inline-code">self</code> 就像是<b>自动填写的收件人</b>——你调用 <code class="notion-inline-code">dog1.bark()</code>，Python 自动把 <code class="notion-inline-code">dog1</code> 填到 <code class="notion-inline-code">self</code> 的位置。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380f0b1d7c6d96377dd3f"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380f8a5bfec1f87c1b6fd" data-id="30e5ea8e53e380f8a5bfec1f87c1b6fd"><span><div id="30e5ea8e53e380f8a5bfec1f87c1b6fd" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380f8a5bfec1f87c1b6fd" title="2.2 self 不是关键字"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.2 self 不是关键字</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e3807898a2c7f65b71e74e"><div>⚠️ <b>注意</b>：<code class="notion-inline-code">self</code> 不是关键字，可以用其他名字，但这是 Python 的<b>强约定</b>，必须遵守！</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380a5adb2d5f4f487ba7a"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e3807d83d1e91eaf758cb4" data-id="30e5ea8e53e3807d83d1e91eaf758cb4"><span><div id="30e5ea8e53e3807d83d1e91eaf758cb4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3807d83d1e91eaf758cb4" title="3. 实例方法的调用"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3. 实例方法的调用</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e38021a105e1eacb98a556" data-id="30e5ea8e53e38021a105e1eacb98a556"><span><div id="30e5ea8e53e38021a105e1eacb98a556" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e38021a105e1eacb98a556" title="3.1 通过对象调用"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.1 通过对象调用</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e380b6b504d980416b704c"><div>📝 <b>我的理解</b>：通过对象调用方法，就像是<b>让具体的机器人执行任务</b>——calc 这个计算器执行加法操作。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380b39fcdd0d2c760b2db"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380b693a3c0671107fd73" data-id="30e5ea8e53e380b693a3c0671107fd73"><span><div id="30e5ea8e53e380b693a3c0671107fd73" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380b693a3c0671107fd73" title="3.2 通过类调用（需要传入实例）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.2 通过类调用（需要传入实例）</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e3808ea9e8dd295034c690"><div>📝 <b>我的理解</b>：通过类调用就像是<b>手动填写收件人</b>——你需要自己告诉方法&quot;这是哪个对象&quot;。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380d18dbefe9ed059a06d"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e380a0be17eb6411abc36e" data-id="30e5ea8e53e380a0be17eb6411abc36e"><span><div id="30e5ea8e53e380a0be17eb6411abc36e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380a0be17eb6411abc36e" title="4. 方法之间的调用"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4. 方法之间的调用</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380478eb6c99729218305" data-id="30e5ea8e53e380478eb6c99729218305"><span><div id="30e5ea8e53e380478eb6c99729218305" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380478eb6c99729218305" title="4.1 同类方法互相调用"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.1 同类方法互相调用</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e380f5bd21e61d8dbf7e81"><div>📝 <b>我的理解</b>：方法之间调用就像是<b>团队成员协作</b>——存款方法需要记录日志，就调用日志方法。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380bda7b7c13b6c678d3c"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e38069b598dbe6883966ea" data-id="30e5ea8e53e38069b598dbe6883966ea"><span><div id="30e5ea8e53e38069b598dbe6883966ea" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e38069b598dbe6883966ea" title="5. 链式调用"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5. 链式调用</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e38097810dc8ab2df5fe9f" data-id="30e5ea8e53e38097810dc8ab2df5fe9f"><span><div id="30e5ea8e53e38097810dc8ab2df5fe9f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e38097810dc8ab2df5fe9f" title="5.1 返回 self 实现链式调用"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.1 返回 self 实现链式调用</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e380ffb325e46acf13ba6a"><div>📝 <b>我的理解</b>：链式调用就像是<b>流水线作业</b>——做完一步自动交给下一步，不用反复写变量名。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e38068a00ce73387e844a2"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e380a48510f0b501658037" data-id="30e5ea8e53e380a48510f0b501658037"><span><div id="30e5ea8e53e380a48510f0b501658037" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380a48510f0b501658037" title="6. 踩坑记录"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">6. 踩坑记录</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380cf9713f7376aba1ff8" data-id="30e5ea8e53e380cf9713f7376aba1ff8"><span><div id="30e5ea8e53e380cf9713f7376aba1ff8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380cf9713f7376aba1ff8" title="6.1 忘记 return self"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">6.1 忘记 return self</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e38083ae68ea8a2bc90ee0"><div>⚠️ <b>踩坑</b>：要实现链式调用，每个方法都必须 <code class="notion-inline-code">return self</code>！</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e3805ab6cec0fd96ca1085"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e38079b0dfe7fe194dc595" data-id="30e5ea8e53e38079b0dfe7fe194dc595"><span><div id="30e5ea8e53e38079b0dfe7fe194dc595" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e38079b0dfe7fe194dc595" title="6.2 在方法内忘记 self."><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">6.2 在方法内忘记 self.</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e38039bbfce30400565479"><div>⚠️ <b>踩坑</b>：在方法内访问实例属性，必须加 <code class="notion-inline-code">self.</code>！</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e3803e809de938a7ab83f2"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e3802e880cc6bd09172189" data-id="30e5ea8e53e3802e880cc6bd09172189"><span><div id="30e5ea8e53e3802e880cc6bd09172189" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3802e880cc6bd09172189" title="7. 核心知识点整理"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">7. 核心知识点整理</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380aebb8afc1e869368a3" data-id="30e5ea8e53e380aebb8afc1e869368a3"><span><div id="30e5ea8e53e380aebb8afc1e869368a3" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380aebb8afc1e869368a3" title="7.1 实例方法规则"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">7.1 实例方法规则</span></span></h4><table class="notion-simple-table notion-block-30e5ea8e53e3801da86bd0e62f8073d7"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-30e5ea8e53e38032b238fe2851563a00"><td class="" style="width:120px"><div class="notion-simple-table-cell">规则</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">说明</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">示例</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e38064a285e3598ff8afdc"><td class="" style="width:120px"><div class="notion-simple-table-cell">第一个参数</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">必须是 <code class="notion-inline-code">self</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">def method(self):</code></div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380debc33c175797c4ed9"><td class="" style="width:120px"><div class="notion-simple-table-cell">调用方式</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">对象.方法()</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">obj.method()</code></div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380d3be3bf3c6c97c4e81"><td class="" style="width:120px"><div class="notion-simple-table-cell">访问属性</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">用 <code class="notion-inline-code">self.属性</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">self.name</code></div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e38031b64fcbcd77659a9a"><td class="" style="width:120px"><div class="notion-simple-table-cell">调用其他方法</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">用 <code class="notion-inline-code">self.方法()</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">self._log()</code></div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380fcaaecc548472d42cd"><td class="" style="width:120px"><div class="notion-simple-table-cell">链式调用</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">返回 <code class="notion-inline-code">self</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">return self</code></div></td></tr></tbody></table><hr class="notion-hr notion-block-30e5ea8e53e3807c9b3fd543e54a57bb"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e38036a28dda3371e65588" data-id="30e5ea8e53e38036a28dda3371e65588"><span><div id="30e5ea8e53e38036a28dda3371e65588" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e38036a28dda3371e65588" title="7.2 方法定义模板"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">7.2 方法定义模板</span></span></h4></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[四、魔法方法学习笔记]]></title>
            <link>https://blog.mcpq.cc/article/python-magic-method-learning-notes-4</link>
            <guid>https://blog.mcpq.cc/article/python-magic-method-learning-notes-4</guid>
            <pubDate>Sat, 21 Feb 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[__init__ 很神奇，不用调用就能执行。后来才知道，这种双下划线开头结尾的方法叫"魔法方法"，它们让对象可以像内置类型一样使用，比如用 + 号相加、用 print 直接输出！]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-30e5ea8e53e380e7ad2ec3a5731e7212"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><blockquote class="notion-quote notion-block-30e5ea8e53e3803b9aaefd65b262454f"><div>💡 <b>学习感悟</b>： <code class="notion-inline-code">__init__</code> 很神奇，不用调用就能执行。后来才知道，这种双下划线开头结尾的方法叫&quot;魔法方法&quot;，它们让对象可以像内置类型一样使用，比如用 <code class="notion-inline-code">+</code> 号相加、用 <code class="notion-inline-code">print</code> 直接输出！</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380c8a3c5c0ce38656336"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e3803ca2cdd3bf99fb0ef7" data-id="30e5ea8e53e3803ca2cdd3bf99fb0ef7"><span><div id="30e5ea8e53e3803ca2cdd3bf99fb0ef7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3803ca2cdd3bf99fb0ef7" title="1. 什么是魔法方法？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1. 什么是魔法方法？</span></span></h3><div class="notion-text notion-block-30e5ea8e53e380998c80e09980cdc2f5"><b>魔法方法</b>（Magic Methods）是双下划线开头结尾的特殊方法，在特定情况下自动调用。</div><blockquote class="notion-quote notion-block-30e5ea8e53e380e1bf8ff6faf3f420d1"><div>📝 <b>我的理解</b>：魔法方法就像是<b>自动触发器</b>——满足条件时自动执行，不需要手动调用。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e3804b9504ed584b8658c4"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e3805f8433e04733739632" data-id="30e5ea8e53e3805f8433e04733739632"><span><div id="30e5ea8e53e3805f8433e04733739632" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3805f8433e04733739632" title="2. 构造与析构"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2. 构造与析构</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380238699c1889533fea0" data-id="30e5ea8e53e380238699c1889533fea0"><span><div id="30e5ea8e53e380238699c1889533fea0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380238699c1889533fea0" title="2.1 init 构造方法"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.1 <b>init</b> 构造方法</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e380f4afabcbd95065289b"><div>📝 <b>我的理解</b>：<code class="notion-inline-code">__init__</code> 就像是<b>新房装修</b>——房子建好了，自动进行装修（初始化）。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e38008ac85ed66f6c5d4b1"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380178278d77eefe4bf2a" data-id="30e5ea8e53e380178278d77eefe4bf2a"><span><div id="30e5ea8e53e380178278d77eefe4bf2a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380178278d77eefe4bf2a" title="2.2 del 析构方法"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.2 <b>del</b> 析构方法</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e3807dbd6ac42237409013"><div>📝 <b>我的理解</b>：<code class="notion-inline-code">__del__</code> 就像是<b>退房清理</b>——离开房间时自动打扫、关闭水电。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380fd83edd838c65f6212"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e3806c874df50cd9bddcc5" data-id="30e5ea8e53e3806c874df50cd9bddcc5"><span><div id="30e5ea8e53e3806c874df50cd9bddcc5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3806c874df50cd9bddcc5" title="3. 字符串表示"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3. 字符串表示</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e3801bb5a9d0fcd5302d1c" data-id="30e5ea8e53e3801bb5a9d0fcd5302d1c"><span><div id="30e5ea8e53e3801bb5a9d0fcd5302d1c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3801bb5a9d0fcd5302d1c" title="3.1 str 用户友好字符串"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.1 <b>str</b> 用户友好字符串</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e38008ac77eb7b49bc8cce"><div>📝 <b>我的理解</b>：<code class="notion-inline-code">__str__</code> 就像是<b>名片</b>——给别人看的，要简洁明了。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e3808bb4def497d781a647"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e38004a9a8e20fdb61d7f7" data-id="30e5ea8e53e38004a9a8e20fdb61d7f7"><span><div id="30e5ea8e53e38004a9a8e20fdb61d7f7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e38004a9a8e20fdb61d7f7" title="3.2 repr 开发者字符串"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.2 <b>repr</b> 开发者字符串</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e38069867dc304b761987b"><div>📝 <b>我的理解</b>：<code class="notion-inline-code">__repr__</code> 就像是<b>身份证</b>——给开发者看的，要详细准确，最好能直接用来重建对象。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380878cede46df8a2896f"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380b59312db5f88f35dab" data-id="30e5ea8e53e380b59312db5f88f35dab"><span><div id="30e5ea8e53e380b59312db5f88f35dab" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380b59312db5f88f35dab" title="3.3 str vs repr"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.3 <b>str</b> vs <b>repr</b></span></span></h4><table class="notion-simple-table notion-block-30e5ea8e53e380c89e93f040fac61fa2"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-30e5ea8e53e3800ba570d940e04d0d42"><td class="" style="width:120px"><div class="notion-simple-table-cell">方法</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">用途</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">调用方式</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">目标用户</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e3807eb4d7e0beccbb1d53"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__str__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">用户友好</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">print(obj)</code>, <code class="notion-inline-code">str(obj)</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">最终用户</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380ce87ebf606911e9fa4"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__repr__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">开发者友好</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">repr(obj)</code>, 交互式解释器</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">开发者</div></td></tr></tbody></table><blockquote class="notion-quote notion-block-30e5ea8e53e380ab91def07d31bbd2e3"><div>💡 <b>建议</b>：至少实现 <code class="notion-inline-code">__repr__</code>，如果 <code class="notion-inline-code">__str__</code> 没定义，会回退到 <code class="notion-inline-code">__repr__</code>。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e3800994ddd8af4d00b1d2"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e3806ca64ad395da1b763d" data-id="30e5ea8e53e3806ca64ad395da1b763d"><span><div id="30e5ea8e53e3806ca64ad395da1b763d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3806ca64ad395da1b763d" title="4. 比较方法"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4. 比较方法</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e3808ab1bdc9eb5463783f" data-id="30e5ea8e53e3808ab1bdc9eb5463783f"><span><div id="30e5ea8e53e3808ab1bdc9eb5463783f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3808ab1bdc9eb5463783f" title="4.1 比较运算符"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.1 比较运算符</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e380c09a02e71c0c7b2a31"><div>📝 <b>我的理解</b>：比较方法就像是<b>评判标准</b>——定义什么情况下两个对象相等，什么情况下一个大一个小。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380ed96f1e4ab0c1e2a6a"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e38015a897ff67a476ad59" data-id="30e5ea8e53e38015a897ff67a476ad59"><span><div id="30e5ea8e53e38015a897ff67a476ad59" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e38015a897ff67a476ad59" title="4.2 比较方法速查"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.2 比较方法速查</span></span></h4><table class="notion-simple-table notion-block-30e5ea8e53e3802db924efbeab278fcc"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-30e5ea8e53e3801b8ac7f40473543fdb"><td class="" style="width:120px"><div class="notion-simple-table-cell">方法</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">运算符</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">含义</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e38073b747cc32175e4e96"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__eq__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">==</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">等于</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380059f85dfb0f5485070"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__ne__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">!=</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">不等于</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e38093b890e4e686f3b22c"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__lt__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&lt;</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">小于</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e38004a408e8bc81f6e055"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__le__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&lt;=</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">小于等于</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380afafd7ce304b53046c"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__gt__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&gt;</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">大于</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380c7a434f04ade8fae65"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__ge__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&gt;=</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">大于等于</div></td></tr></tbody></table><hr class="notion-hr notion-block-30e5ea8e53e380fcbfcacd66c6c0f2ed"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e3809ab3aac89176f8c5ae" data-id="30e5ea8e53e3809ab3aac89176f8c5ae"><span><div id="30e5ea8e53e3809ab3aac89176f8c5ae" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3809ab3aac89176f8c5ae" title="5. 算术运算符"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5. 算术运算符</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380c299b1e93d6dd95323" data-id="30e5ea8e53e380c299b1e93d6dd95323"><span><div id="30e5ea8e53e380c299b1e93d6dd95323" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380c299b1e93d6dd95323" title="5.1 加减乘除"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.1 加减乘除</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e380b39ea0ea7caca7cc10"><div>📝 <b>我的理解</b>：算术方法就像是<b>运算符重载</b>——让自定义对象也能用 <code class="notion-inline-code">+</code> <code class="notion-inline-code">-</code> <code class="notion-inline-code">*</code> <code class="notion-inline-code">/</code> 等运算符。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e38004a427c5189218a2f1"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380a292a7dc1ad08aef4c" data-id="30e5ea8e53e380a292a7dc1ad08aef4c"><span><div id="30e5ea8e53e380a292a7dc1ad08aef4c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380a292a7dc1ad08aef4c" title="5.2 算术运算符速查"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.2 算术运算符速查</span></span></h4><table class="notion-simple-table notion-block-30e5ea8e53e380bd90aece810a7f636c"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-30e5ea8e53e3808980edfe3e6becbc9d"><td class="" style="width:120px"><div class="notion-simple-table-cell">方法</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">运算符</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">含义</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380debf76c0552f0b5d22"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__add__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">+</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">加法</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e38025b75af84f79106c13"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__sub__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">-</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">减法</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e3800e8d23c5c55bb4bc5b"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__mul__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">*</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">乘法</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e38096bac3d17b6ff9f7c1"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__truediv__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">/</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">除法</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380f6b55eceb6eccfc399"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__floordiv__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">//</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">整除</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380c9a698c8ae47cccaae"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__mod__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">%</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">取模</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e3807d94b8dbd72eddba92"><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__pow__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">**</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">幂运算</div></td></tr></tbody></table><hr class="notion-hr notion-block-30e5ea8e53e380088969cb517f062885"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e38063a1bec087d926b591" data-id="30e5ea8e53e38063a1bec087d926b591"><span><div id="30e5ea8e53e38063a1bec087d926b591" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e38063a1bec087d926b591" title="6. 容器类型方法"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">6. 容器类型方法</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e3805cbec6e2025e609dea" data-id="30e5ea8e53e3805cbec6e2025e609dea"><span><div id="30e5ea8e53e3805cbec6e2025e609dea" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3805cbec6e2025e609dea" title="6.1 让对象像列表一样使用"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">6.1 让对象像列表一样使用</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e3809c8c91fe8052647df7"><div>📝 <b>我的理解</b>：容器方法就像是<b>模仿秀</b>——让自定义对象也能像列表、字典一样用 <code class="notion-inline-code">[]</code> 和 <code class="notion-inline-code">in</code>。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e3804e83a3e1c43705286f"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e380e0ad70f207fcc404c4" data-id="30e5ea8e53e380e0ad70f207fcc404c4"><span><div id="30e5ea8e53e380e0ad70f207fcc404c4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380e0ad70f207fcc404c4" title="7. 可调用对象"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">7. 可调用对象</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e3802a85b4f8f93361c086" data-id="30e5ea8e53e3802a85b4f8f93361c086"><span><div id="30e5ea8e53e3802a85b4f8f93361c086" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3802a85b4f8f93361c086" title="7.1 call 方法"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">7.1 <b>call</b> 方法</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e380ada07bf8307c9983ae"><div>📝 <b>我的理解</b>：<code class="notion-inline-code">__call__</code> 就像是<b>变形金刚</b>——对象可以变成函数的样子，直接加括号调用。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e38098b446e06eca8326ee"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e3806b81eed83885954514" data-id="30e5ea8e53e3806b81eed83885954514"><span><div id="30e5ea8e53e3806b81eed83885954514" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3806b81eed83885954514" title="8. 踩坑记录"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">8. 踩坑记录</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380228ed3f64a2a5a3449" data-id="30e5ea8e53e380228ed3f64a2a5a3449"><span><div id="30e5ea8e53e380228ed3f64a2a5a3449" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380228ed3f64a2a5a3449" title="8.1 只定义 eq 不定义 hash"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">8.1 只定义 <b>eq</b> 不定义 <b>hash</b></span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e3808db381c22523e656cb"><div>⚠️ <b>踩坑</b>：定义了 <code class="notion-inline-code">__eq__</code> 后，对象默认不可哈希，不能放入 <code class="notion-inline-code">set</code> 或作为 <code class="notion-inline-code">dict</code> 的 key！</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e3804fbe40fb868d01345f"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e38068a7b3c7e24f5200fb" data-id="30e5ea8e53e38068a7b3c7e24f5200fb"><span><div id="30e5ea8e53e38068a7b3c7e24f5200fb" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e38068a7b3c7e24f5200fb" title="8.2 修改可变对象返回自身"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">8.2 修改可变对象返回自身</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e380c68615c6eebf262c79"><div>⚠️ <b>踩坑</b>：算术运算应该返回<b>新对象</b>，而不是修改自身（除非你想实现 <code class="notion-inline-code">+=</code> 的 <code class="notion-inline-code">__iadd__</code>）！</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380b1bcdac4a79202e845"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e380b8abcbd32671d34117" data-id="30e5ea8e53e380b8abcbd32671d34117"><span><div id="30e5ea8e53e380b8abcbd32671d34117" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380b8abcbd32671d34117" title="9. 核心知识点整理"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">9. 核心知识点整理</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380a5be9bd32f283aadd4" data-id="30e5ea8e53e380a5be9bd32f283aadd4"><span><div id="30e5ea8e53e380a5be9bd32f283aadd4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380a5be9bd32f283aadd4" title="9.1 常用魔法方法速查"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">9.1 常用魔法方法速查</span></span></h4><table class="notion-simple-table notion-block-30e5ea8e53e3802e856ed1bef02b68e0"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-30e5ea8e53e380aea310f26af33af3bf"><td class="" style="width:120px"><div class="notion-simple-table-cell">类别</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">方法</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">触发条件</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e3806cb1e6f1183dcdfc7e"><td class="" style="width:120px"><div class="notion-simple-table-cell">构造析构</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__init__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">创建对象</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380098b64da1319e66ab1"><td class="" style="width:120px"><div class="notion-simple-table-cell">ㅤ</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__del__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">删除对象</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e38006873ff0f638ef956e"><td class="" style="width:120px"><div class="notion-simple-table-cell">字符串</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__str__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">print()</code>, <code class="notion-inline-code">str()</code></div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e3801abfeec5d30e24d201"><td class="" style="width:120px"><div class="notion-simple-table-cell">ㅤ</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__repr__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">repr()</code>, 交互式解释器</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380c3bcf7fcc052081a93"><td class="" style="width:120px"><div class="notion-simple-table-cell">比较</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__eq__</code>, <code class="notion-inline-code">__ne__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">==</code>, <code class="notion-inline-code">!=</code></div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380b699e1f97e924e251c"><td class="" style="width:120px"><div class="notion-simple-table-cell">ㅤ</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__lt__</code>, <code class="notion-inline-code">__le__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&lt;</code>, <code class="notion-inline-code">&lt;=</code></div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e38022889ed19a42f713c1"><td class="" style="width:120px"><div class="notion-simple-table-cell">ㅤ</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__gt__</code>, <code class="notion-inline-code">__ge__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">&gt;</code>, <code class="notion-inline-code">&gt;=</code></div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380929c2dfbf6caa6df7a"><td class="" style="width:120px"><div class="notion-simple-table-cell">算术</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__add__</code>, <code class="notion-inline-code">__sub__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">+</code>, <code class="notion-inline-code">-</code></div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380c8a97fdf618e54e22c"><td class="" style="width:120px"><div class="notion-simple-table-cell">ㅤ</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__mul__</code>, <code class="notion-inline-code">__truediv__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">*</code>, <code class="notion-inline-code">/</code></div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e3805a89f6ff93799c631d"><td class="" style="width:120px"><div class="notion-simple-table-cell">容器</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__len__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">len()</code></div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e3808ab251ee0c620de508"><td class="" style="width:120px"><div class="notion-simple-table-cell">ㅤ</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__getitem__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">obj[key]</code></div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380c99f80f17c9ffd411e"><td class="" style="width:120px"><div class="notion-simple-table-cell">ㅤ</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__setitem__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">obj[key] = value</code></div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380d3bb90c6e2b27d3ef2"><td class="" style="width:120px"><div class="notion-simple-table-cell">ㅤ</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__contains__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">in</code></div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380f38530d57f16e455bf"><td class="" style="width:120px"><div class="notion-simple-table-cell">可调用</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__call__</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">obj()</code></div></td></tr></tbody></table><hr class="notion-hr notion-block-30e5ea8e53e380ad8371ee0303399cf1"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e3806491f5f351e93bb14a" data-id="30e5ea8e53e3806491f5f351e93bb14a"><span><div id="30e5ea8e53e3806491f5f351e93bb14a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3806491f5f351e93bb14a" title="9.2 魔法方法命名规则"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">9.2 魔法方法命名规则</span></span></h4><ul class="notion-list notion-list-disc notion-block-30e5ea8e53e380f1a746d7730b06979e"><li>双下划线开头：<code class="notion-inline-code">__xxx</code></li></ul><ul class="notion-list notion-list-disc notion-block-30e5ea8e53e38030b705d88996a1c630"><li>双下划线结尾：<code class="notion-inline-code">xxx__</code></li></ul><ul class="notion-list notion-list-disc notion-block-30e5ea8e53e380208905ec7ed6c6891a"><li>不要自己发明魔法方法，只用 Python 定义的</li></ul></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[五、实例属性与类属性学习笔记]]></title>
            <link>https://blog.mcpq.cc/article/python-instance-and-class-attribute-learning-notes-5</link>
            <guid>https://blog.mcpq.cc/article/python-instance-and-class-attribute-learning-notes-5</guid>
            <pubDate>Sat, 21 Feb 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[什么时候用类属性。后来才明白，实例属性就像是每个人的钱包——每个人有自己的；类属性就像是学校的校名——所有学生共享同一个！]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-30e5ea8e53e3803f8e7fdde9d88ef007"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><blockquote class="notion-quote notion-block-30e5ea8e53e380368df6f2808222f9d2"><div>💡 <b>学习感悟</b>：什么时候用类属性。后来才明白，实例属性就像是<b>每个人的钱包</b>——每个人有自己的；类属性就像是<b>学校的校名</b>——所有学生共享同一个！</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380a2ab94d7ece905cf04"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e380bba4d9eee3c4da7226" data-id="30e5ea8e53e380bba4d9eee3c4da7226"><span><div id="30e5ea8e53e380bba4d9eee3c4da7226" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380bba4d9eee3c4da7226" title="1. 实例属性"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1. 实例属性</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e38098adc8f0b89d2f147d" data-id="30e5ea8e53e38098adc8f0b89d2f147d"><span><div id="30e5ea8e53e38098adc8f0b89d2f147d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e38098adc8f0b89d2f147d" title="1.1 什么是实例属性？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1.1 什么是实例属性？</span></span></h4><div class="notion-text notion-block-30e5ea8e53e380039444f361e1ef9cc8"><b>实例属性</b>是属于具体对象的属性，每个对象独立拥有。</div><blockquote class="notion-quote notion-block-30e5ea8e53e380cab729e87a32c1264a"><div>📝 <b>我的理解</b>：实例属性就像是<b>个人档案</b>——每个学生有自己的姓名、年龄，修改一个不会影响另一个。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380d6ab76e141fe4d2655"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e3800c8e40ddf5438f84a5" data-id="30e5ea8e53e3800c8e40ddf5438f84a5"><span><div id="30e5ea8e53e3800c8e40ddf5438f84a5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3800c8e40ddf5438f84a5" title="1.2 动态添加实例属性"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1.2 动态添加实例属性</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e380eda8a9e1dc807faf97"><div>⚠️ <b>注意</b>：Python 允许动态添加属性，但<b>不推荐</b>，容易让代码难以维护！</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380ca8883f2db167fd61c"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e380dc86d6eb104badc2a7" data-id="30e5ea8e53e380dc86d6eb104badc2a7"><span><div id="30e5ea8e53e380dc86d6eb104badc2a7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380dc86d6eb104badc2a7" title="2. 类属性"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2. 类属性</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380eab73dfc4cd84f24c5" data-id="30e5ea8e53e380eab73dfc4cd84f24c5"><span><div id="30e5ea8e53e380eab73dfc4cd84f24c5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380eab73dfc4cd84f24c5" title="2.1 什么是类属性？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.1 什么是类属性？</span></span></h4><div class="notion-text notion-block-30e5ea8e53e38090a90ac803e4530e34"><b>类属性</b>是属于类的属性，所有实例共享。</div><blockquote class="notion-quote notion-block-30e5ea8e53e38077bb3ce4f092b00fe9"><div>📝 <b>我的理解</b>：类属性就像是<b>公共资源</b>——学校的图书馆、操场，所有学生共享。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e3809bb48dfa3af0185150"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380ef89e3cf2e080ef92e" data-id="30e5ea8e53e380ef89e3cf2e080ef92e"><span><div id="30e5ea8e53e380ef89e3cf2e080ef92e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380ef89e3cf2e080ef92e" title="2.2 修改类属性"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.2 修改类属性</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e3805fa967d4a2dfcde9a1"><div>📝 <b>我的理解</b>：修改类属性就像是<b>学校改名</b>——一改全改，所有学生都知道新名字。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380b0b4ded8fb4a94badf"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e38057ab8cf1cf990df055" data-id="30e5ea8e53e38057ab8cf1cf990df055"><span><div id="30e5ea8e53e38057ab8cf1cf990df055" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e38057ab8cf1cf990df055" title="3. 实例属性 vs 类属性"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3. 实例属性 vs 类属性</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e38082814bfcaea09a30c8" data-id="30e5ea8e53e38082814bfcaea09a30c8"><span><div id="30e5ea8e53e38082814bfcaea09a30c8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e38082814bfcaea09a30c8" title="3.1 对比表"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.1 对比表</span></span></h4><table class="notion-simple-table notion-block-30e5ea8e53e3808a99e0cbbbc8f988f0"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-30e5ea8e53e380ecbcc1cc670112b4c2"><td class="" style="width:120px"><div class="notion-simple-table-cell">特性</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">实例属性</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">类属性</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e3806eb3f0e978d3ac5490"><td class="" style="width:120px"><div class="notion-simple-table-cell">定义位置</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">__init__</code> 中，<code class="notion-inline-code">self.属性</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">类内部，方法外部</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380d49155ffe7357cfdb0"><td class="" style="width:120px"><div class="notion-simple-table-cell">归属</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">属于实例</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">属于类</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380879bb8d0641dc8aae9"><td class="" style="width:120px"><div class="notion-simple-table-cell">共享性</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">每个实例独立</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">所有实例共享</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e3808982a5fb733337a5c7"><td class="" style="width:120px"><div class="notion-simple-table-cell">访问方式</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">实例.属性</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">类.属性</code> 或 <code class="notion-inline-code">实例.属性</code></div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380a488b6c4d8f9612a3b"><td class="" style="width:120px"><div class="notion-simple-table-cell">修改影响</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">只影响当前实例</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">影响所有实例</div></td></tr></tbody></table><hr class="notion-hr notion-block-30e5ea8e53e3805baf33e2c04f75016a"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380639e50f5b475b0340c" data-id="30e5ea8e53e380639e50f5b475b0340c"><span><div id="30e5ea8e53e380639e50f5b475b0340c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380639e50f5b475b0340c" title="3.2 内存示意图"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.2 内存示意图</span></span></h4><hr class="notion-hr notion-block-30e5ea8e53e38033bde0c5c4dec0631d"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e3802ea6d5e9247bb71c08" data-id="30e5ea8e53e3802ea6d5e9247bb71c08"><span><div id="30e5ea8e53e3802ea6d5e9247bb71c08" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3802ea6d5e9247bb71c08" title="4. 属性查找顺序"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4. 属性查找顺序</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380f9810bd745b39dcff8" data-id="30e5ea8e53e380f9810bd745b39dcff8"><span><div id="30e5ea8e53e380f9810bd745b39dcff8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380f9810bd745b39dcff8" title="4.1 查找规则"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.1 查找规则</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e380608d6bd84fdcfe47fe"><div>📝 <b>我的理解</b>：属性查找就像是<b>找东西</b>——先翻自己口袋（实例属性），没有就去公共区域（类属性）找。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380129361c4e8ad8701eb"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e3806aa740efe10de3cf3e" data-id="30e5ea8e53e3806aa740efe10de3cf3e"><span><div id="30e5ea8e53e3806aa740efe10de3cf3e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3806aa740efe10de3cf3e" title="4.2 实例属性遮蔽类属性"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.2 实例属性遮蔽类属性</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e3800f8113de4f8038ab60"><div>📝 <b>我的理解</b>：实例属性遮蔽就像是<b>个人习惯覆盖集体规定</b>——学校规定8点上课（类属性），但你习惯7点到（实例属性），你自己的习惯优先。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e38070b194c666e06e9ac9"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e38040a25cf549d70844ec" data-id="30e5ea8e53e38040a25cf549d70844ec"><span><div id="30e5ea8e53e38040a25cf549d70844ec" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e38040a25cf549d70844ec" title="5. 类属性的陷阱"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5. 类属性的陷阱</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380469a4bc8884f45d866" data-id="30e5ea8e53e380469a4bc8884f45d866"><span><div id="30e5ea8e53e380469a4bc8884f45d866" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380469a4bc8884f45d866" title="5.1 可变类属性"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.1 可变类属性</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e3805b9b0aee8f29f6e390"><div>⚠️ <b>踩坑</b>：类属性使用可变对象（list、dict）时，所有实例共享，修改会影响全部！</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380949555f4275f38d8ee"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380d7a1aecf85d761a5a6" data-id="30e5ea8e53e380d7a1aecf85d761a5a6"><span><div id="30e5ea8e53e380d7a1aecf85d761a5a6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380d7a1aecf85d761a5a6" title="5.2 正确使用可变属性"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.2 正确使用可变属性</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e38021aa53de6e7a1b596c"><div>📝 <b>我的理解</b>：可变数据（list、dict）应该作为<b>实例属性</b>，每个对象有自己的一份，互不干扰。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e3808c9f6afe2d205480e4"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e3800a8beed9225a1c2ff0" data-id="30e5ea8e53e3800a8beed9225a1c2ff0"><span><div id="30e5ea8e53e3800a8beed9225a1c2ff0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3800a8beed9225a1c2ff0" title="6. 类属性的使用场景"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">6. 类属性的使用场景</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e38047aa02ffb6d62e0c51" data-id="30e5ea8e53e38047aa02ffb6d62e0c51"><span><div id="30e5ea8e53e38047aa02ffb6d62e0c51" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e38047aa02ffb6d62e0c51" title="6.1 计数器"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">6.1 计数器</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e3801a93f0e5e51ab83840"><div>📝 <b>我的理解</b>：类属性计数器就像是<b>签到表</b>——每来一个学生签个到，总数自动更新。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380cb9cd2d696a7adbaa3"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380e0b811f9f6d86cf8d7" data-id="30e5ea8e53e380e0b811f9f6d86cf8d7"><span><div id="30e5ea8e53e380e0b811f9f6d86cf8d7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380e0b811f9f6d86cf8d7" title="6.2 常量配置"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">6.2 常量配置</span></span></h4><blockquote class="notion-quote notion-block-30e5ea8e53e3807a90c3dc89b26301d1"><div>📝 <b>我的理解</b>：类属性配置就像是<b>系统设置</b>——数据库地址、端口号，所有连接共享同一套配置。</div></blockquote><hr class="notion-hr notion-block-30e5ea8e53e380b1b205d911ee75e72a"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-30e5ea8e53e3809eb425e449467e65db" data-id="30e5ea8e53e3809eb425e449467e65db"><span><div id="30e5ea8e53e3809eb425e449467e65db" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3809eb425e449467e65db" title="7. 核心知识点整理"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">7. 核心知识点整理</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e3805b8d7ec2c05e6a54ea" data-id="30e5ea8e53e3805b8d7ec2c05e6a54ea"><span><div id="30e5ea8e53e3805b8d7ec2c05e6a54ea" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3805b8d7ec2c05e6a54ea" title="7.1 选择实例属性还是类属性？"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">7.1 选择实例属性还是类属性？</span></span></h4><table class="notion-simple-table notion-block-30e5ea8e53e380c6bf55c3c57ff50324"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-30e5ea8e53e3802c8683ff735cc2dfc0"><td class="" style="width:120px"><div class="notion-simple-table-cell">场景</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">推荐</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">原因</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e38077bb36d08b0c8fa6e5"><td class="" style="width:120px"><div class="notion-simple-table-cell">每个对象不同的数据</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">实例属性</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">独立存储</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e3804dbbddfd51f09f69c0"><td class="" style="width:120px"><div class="notion-simple-table-cell">所有对象共享的数据</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">类属性</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">节省内存</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e3803d846eeb7f8b2f4359"><td class="" style="width:120px"><div class="notion-simple-table-cell">计数、统计</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">类属性</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">全局共享</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e380eda245d9173162d578"><td class="" style="width:120px"><div class="notion-simple-table-cell">配置、常量</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">类属性</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">统一修改</div></td></tr><tr class="notion-simple-table-row notion-block-30e5ea8e53e3803eb504c93451c6793c"><td class="" style="width:120px"><div class="notion-simple-table-cell">可变数据（list、dict）</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">实例属性</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">避免意外共享</div></td></tr></tbody></table><hr class="notion-hr notion-block-30e5ea8e53e3800cafa6d71877b89f45"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e3801cba63f0101594edc0" data-id="30e5ea8e53e3801cba63f0101594edc0"><span><div id="30e5ea8e53e3801cba63f0101594edc0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e3801cba63f0101594edc0" title="7.2 属性查找顺序"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">7.2 属性查找顺序</span></span></h4><hr class="notion-hr notion-block-30e5ea8e53e38091bd5feb1926089b39"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-30e5ea8e53e380b0a6c7c23eb4839cfa" data-id="30e5ea8e53e380b0a6c7c23eb4839cfa"><span><div id="30e5ea8e53e380b0a6c7c23eb4839cfa" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30e5ea8e53e380b0a6c7c23eb4839cfa" title="7.3 类属性 vs 实例属性模板"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">7.3 类属性 vs 实例属性模板</span></span></h4></main></div>]]></content:encoded>
        </item>
    </channel>
</rss>