惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Apple Machine Learning Research
Apple Machine Learning Research
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 司徒正美
博客园_首页
博客园 - 叶小钗
Blog — PlanetScale
Blog — PlanetScale
The Cloudflare Blog
量子位
人人都是产品经理
人人都是产品经理
小众软件
小众软件
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
Attack and Defense Labs
Attack and Defense Labs
Hacker News: Ask HN
Hacker News: Ask HN
TaoSecurity Blog
TaoSecurity Blog
Forbes - Security
Forbes - Security
罗磊的独立博客
Webroot Blog
Webroot Blog
美团技术团队
Help Net Security
Help Net Security
Google DeepMind News
Google DeepMind News
博客园 - 三生石上(FineUI控件)
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
H
Heimdal Security Blog
C
Check Point Blog
V2EX - 技术
V2EX - 技术
The Last Watchdog
The Last Watchdog
Microsoft Azure Blog
Microsoft Azure Blog
AI
AI
Cloudbric
Cloudbric
Application and Cybersecurity Blog
Application and Cybersecurity Blog
W
WeLiveSecurity
P
Privacy International News Feed
T
The Exploit Database - CXSecurity.com
P
Privacy & Cybersecurity Law Blog
B
Blog RSS Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
L
LINUX DO - 热门话题
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
Arctic Wolf
O
OpenAI News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 【当耐特】
C
Cyber Attacks, Cyber Crime and Cyber Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Y
Y Combinator Blog
Know Your Adversary
Know Your Adversary

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Quark's Outlines: Python Internal Types
Mike Vincent · 2026-04-25 · via DEV Community

Quark’s Outlines: Python Internal Types

Overview, Historical Timeline, Problems & Solutions

An Overview of Python Internal Types

What are Python internal types?

You use Python every day to write programs, but some parts of Python stay hidden. These are called internal types. They work behind the scenes to help your code run. You do not make these objects directly, but Python creates them while it runs your program.

Some internal types include code objects, frame objects, traceback objects, and slice objects. These objects store details about your code, the stack, and how Python handles errors or slices. You can inspect them using built-in tools or system modules.

Python uses internal types to manage execution, errors, and slicing.

type(slice(1, 5, 2))  # <class 'slice'>

Enter fullscreen mode Exit fullscreen mode

This line shows that slice(1, 5, 2) creates a slice object. Python builds this object when you write slicing code.

How does Python use code objects?

A code object is a block of Python instructions. Python creates a code object when you define a function. The code object holds the function's bytecode, argument names, and other parts. It does not know the function's global variables.

You can get a function's code object using the __code__ attribute.

Python stores instructions using code objects.

def greet(name): return f"Hi, {name}"
print(greet.__code__.co_varnames)  # ('name',)

Enter fullscreen mode Exit fullscreen mode

This prints the list of variable names used in the function. Code objects are read-only and do not change after creation.

What are Python frame objects?

A frame object shows the state of Python when it runs a line of code. Each time Python calls a function, it builds a frame. That frame stores the current code object, the local and global variables, and the current line number.

Frames are stacked. When one function calls another, Python adds a new frame on top of the stack.

Python uses frame objects to track function calls.

import inspect
def check(): print(inspect.currentframe().f_code.co_name)
check()  # check

Enter fullscreen mode Exit fullscreen mode

This prints the name of the function running in the current frame. Frames help tools like debuggers and tracers understand what your code is doing.

How does Python use traceback objects?

When your code has an error, Python creates a traceback object. The traceback shows the call stack at the time of the error. Each level of the stack gets one traceback object.

Traceback objects help Python explain where the error came from. The last one in the chain shows the line where the error happened.

Python uses traceback objects to explain errors.

import sys
try: 1 / 0
except: print(sys.exc_info()[2].tb_lineno)  # 2

Enter fullscreen mode Exit fullscreen mode

This prints the line number where the error happened. You can use traceback objects to write logs or format error messages.

What is a Python slice object?

A slice object tells Python how to cut a list or a string. It stores a start, stop, and step value. Python makes a slice object when you use a colon : in brackets.

You can also create one directly using slice(start, stop, step). The values may be numbers or None.

Python uses slice objects to slice sequences.

s = slice(2, 10, 2)
print(range(20)[s])  # range(2, 10, 2)

Enter fullscreen mode Exit fullscreen mode

This prints the values at index 2, 4, 6, and 8. Python reads the slice object and uses it to cut the data.


A Historical Timeline of Python Internal Types

How did Python internal types develop?

Python internal types grew from the need to manage code execution and error handling. These types are not part of daily Python use, but they support every Python program behind the scenes.


People invented stack frames and bytecode

1959 — Stack frame tracking, IBM 1401, made it easier to debug and resume execution.

1970 — Bytecode instructions, Pascal P-code, created a way to compile programs to simple portable steps.

People designed Python’s execution system

1991 — Code and frame types, Python 0.9.0, added code objects and frame objects for functions and the call stack.

2000 — Traceback objects, Python 2.0, exposed tracebacks to help with exception handling and logging.

People improved slice handling

2001 — Slice object support, Python 2.2, added the slice type and allowed extended slicing syntax.

2008 — Full Unicode traceback, Python 3.0, improved traceback readability for all users.

2025 — Internal types frozen, Python core team, made internal object formats stable for tooling.


Problems & Solutions with Python Internal Types

How do Python internal types help your program run?

Python creates internal types to hold bytecode, manage stack frames, store errors, and handle slices. These objects are not part of your script, but they shape how Python works. Each problem shows how an internal type helps solve a task that Python must handle behind the scenes.


Problem: How do you understand what your function does at runtime in Python?

You write a function that behaves strangely. You want to inspect what it does under the hood without changing its code.

Problem: How can you view the internal steps or structure of a function?

Solution: Python stores details in a code object. You can access it using __code__.

Python lets you inspect bytecode and arguments with code objects.

def double(x): return x * 2
print(double.__code__.co_varnames)  # ('x',)

Enter fullscreen mode Exit fullscreen mode

This shows that the function takes one variable named x.


Problem: How do you follow what happens when a program runs in Python?

You call one function, which calls another, and so on. Something breaks, and you want to trace which part of the code is running right now.

Problem: How can you follow the stack of function calls?

Solution: Python builds frame objects to track each function call.

Python lets you view the call stack with frame objects.

import inspect
def trace(): print(inspect.currentframe().f_back.f_code.co_name)
def outer(): trace()
outer()  # outer

Enter fullscreen mode Exit fullscreen mode

This prints the name of the function that called trace.


Problem: How do you locate where an error happened in Python?

You run a block of code and it crashes. You want to know exactly which line caused the crash.

Problem: How can you find the error line programmatically?

Solution: Python creates a traceback object that stores the error location.

Python gives you line numbers from traceback objects.

import sys
try: 1 / 0
except: print(sys.exc_info()[2].tb_lineno)  # 2

Enter fullscreen mode Exit fullscreen mode

This prints the line where the error happened, not where the traceback is printed.


Problem: How do you use a slice with three parts in Python?

You want to extract every third value from a list between two positions. The usual slice a:b is not enough.

Problem: How can you express a slice with a step value?

Solution: Python creates a slice object with start, stop, and step.

Python lets you define steps with slice objects.

items = list(range(10))
s = slice(1, 8, 3)
print(items[s])  # [1, 4, 7]

Enter fullscreen mode Exit fullscreen mode

The slice picks index 1, then 4, then 7.


Problem: How do you log what happened after an error in Python?

You run a function that fails. You want to keep a clean log that includes the path of calls and the code line where it failed.

Problem: How do you log errors with full context?

Solution: Python keeps a chain of traceback objects for the whole stack.

Python lets you trace errors step-by-step with traceback objects.

import sys, traceback
try: 1 / 0
except:
    tb = sys.exc_info()[2]
    while tb:
        print(tb.tb_frame.f_code.co_name, tb.tb_lineno)
        tb = tb.tb_next
# <module> 2

Enter fullscreen mode Exit fullscreen mode

This prints the stack trace with function names and line numbers in order.


Like, Comment, Share, and Subscribe

Did you find this helpful? Let me know by clicking the like button below. I'd love to hear your thoughts in the comments, too! If you want to see more content like this, don't forget to subscribe. Thanks for reading!


Mike Vincent is an American software engineer and app developer from Los Angeles, California. More about Mike Vincent