开发者交流平台
开发者交流平台

通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。

bj
登录
  • 友情链接
站内
python-typing

python-typing

go

What's the correct way to type hint an empty list as a literal in python?

英文: What's the correct way to type hint an empty list as a literal in python? 问题 我有一个总是返回空列表的函数(...
huangapple 2023年8月11日629评论python python-typing
go

如何测试`__annotations__`成员的类型与泛型类参数相同?

英文: How to test __annotations__ member has same type as generic class parameter? 问题 我想能够只选择已注释的成员,这些...
huangapple 2023年8月10日225评论generics python
go

将Python方法的通用参数默认分配给类的通用参数

英文: Assign Python method generic argument to class generic argument by default 问题 假设我想要一个返回通用类型的方法,并...
huangapple 2023年8月8日180评论python python-typing
go

在__init__内部给当前类添加类型提示。

英文: Type hint current class inside __init__ 问题 让我们想象一下,我有一个类: class Node: def __init__(self, value=N...
huangapple 2023年8月5日174评论python python-typing
go

Type hint issue when base class is parameterized on a value type and has methods that return that type

英文: Type hint issue when base class is parameterized on a value type and has methods that return tha...
huangapple 2023年7月3日180评论python python-typing
go

如何为一个分块器函数添加类型注解?

英文: How to type annotate a chunker function? 问题 以下是您要翻译的代码部分: from typing import Iterator, List, Any...
huangapple 2023年6月29日188评论python python-3.x
go

Python 3.9 使用 OR | 运算符表示联合类型吗?

英文: Python 3.9 use OR | operator for Union types? 问题 自Python版本3.10开始,可以使用X | Y表示联合类型,与Union[X, Y]等效。...
huangapple 2023年6月29日199评论pydantic python
go

Python中使用*args定义一个Callable,同时强制执行第一个参数。

英文: Python typing a Callable with *args while enforcing the first argument 问题 在以下代码中(在PyCharm上工作),我在...
huangapple 2023年6月27日228评论class python
go

Python typing: Pylance不显示输入类型

英文: Python typing: pylance doesn't show input types 问题 以下是您要翻译的内容: 我正在尝试为任何可调用对象创建“包装器”类。以下是最小示例...
huangapple 2023年6月26日243评论python wrapper
go

Pylance 中 Union 类型变量的类型推断问题

英文: Type inference issue in Pylance for a variable of Union type 问题 我正在编写一个根据参数是标量还是NumPy数组而具有不同行为的函...
huangapple 2023年6月19日232评论numpy python

文章导航

1 2 3
name
开发者交流平台
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
文章117266 留言 4 访客13634422

热门标签

json c++ html css java pandas typescript javascript node.js reactjs spring arrays spring-boot sql python flutter android r c# go

悟已往之不谏,知来者之可追!

今日
00%
已00小时
本周
00%
已过00天
本月
00%
已过00天
今年
00%
已是00月

Copyright ©  开发者交流平台 版权所有.

闽 ICP 备 2022019110 号 - 1
  • 开发者交流平台

    本页二维码