腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
2
回答
Python
typing
.get_args和
typing
.Union
python-3.8
、
type-hinting
、
python-typing
、
union-types
使用
typing
.Union时,我无法获得有关该参数的任何信息print(
typing
.get_args(x))def f(y:
typing
.Union[str,int]): f(1)
浏览 8
提问于2022-12-01
得票数 0
1
回答
Python类型提示:
typing
.Mapping与
typing
.Dict
python
、
python-3.x
、
type-hinting
我正在做一个python3项目,在这个项目中,我们始终使用
typing
模块类型提示。有理由更喜欢其中一个吗?
浏览 7
提问于2018-09-25
得票数 61
回答已采纳
1
回答
如何加快运行功能
google-apps-script
、
optimization
、
google-sheets
=1; var MAX_Day = 31; for (
Typing
_Month;
Typing
_Month< 13;
Typing
_Month++)==3)||(
Typing
_Month==5)||(
Typing
_Month==7)||(
Typing
_Month==8)||(
Typing
_Month==10)||(
Typing
_Month==12)) { MAX_Day=31;
浏览 0
提问于2020-06-04
得票数 1
回答已采纳
2
回答
在
typing
.List<~T>的类库中,
typing
.Tuple[int][
typing
.Tuple[int]]意味着什么?
python
、
typing
在玩Python的
typing
模块时,我发现了一些奇怪的东西:>>> List[Tuple[int]]这个类似Java的语法List<~T>是什么?
浏览 4
提问于2016-11-07
得票数 4
回答已采纳
2
回答
typing
.NamedTuple和PyCharm
python
、
python-3.x
、
pycharm
、
python-3.5
我怎样才能让
typing
.NamedTuple和PyCharm玩得更好?collections.namedtuple工作得很好:B = collections.namedtuple('B', ['i'])b.iimport
typing
a = A(1) a
浏览 7
提问于2016-03-17
得票数 8
回答已采纳
1
回答
如何定义不是类的泛型类型?
type-hinting
、
mypy
、
python-typing
、
python-3.9
类似于: T = TypeVar('T')# mypy error: Variable "
typing
.Generic因此,更需要缩短模式,因为我需要将其用于不同的参数类型: from
typing
import Sequence, Union, TypeVar, Generic passerror: Cannot resolve name "RecurSeqOf" (p
浏览 32
提问于2021-02-25
得票数 1
回答已采纳
1
回答
如何擦除文本字符串中的字符
java
、
processing
= CODED) {
typing
=
typing
+ key; } if (
typing
.length() > 0) { }
浏览 0
提问于2012-12-20
得票数 1
回答已采纳
1
回答
无法为相互递归谓词计算归纳规则
isabelle
and collection_parts_
typing
where| "collection_parts_
typing
Γ prts τ ⟹| "collection_parts_
typing
Γ [] OclVoid" | "⟦
t
浏览 3
提问于2018-12-25
得票数 1
回答已采纳
2
回答
PHP Session_start挂起了
php
、
session
['
typing
2']); } else { }unset($_SESSION['
typing
']); } if ($_SESSION['
typing
'] != $
typing
_id && !iss
浏览 6
提问于2010-02-24
得票数 6
1
回答
如何正确地在socket.io和jquery中进行键入并停止键入?
jquery
、
node.js
、
socket.io
这是我的尝试function timeoutFunction() { socket.emit("
typing
", false);} console.log('happening');
typing
= true;socket.emit('
typing
',
浏览 5
提问于2016-01-31
得票数 2
回答已采纳
1
回答
Python 3.9+
typing
.Collection vs tuple vs
typing
.Iterable
python
、
python-3.x
、
python-typing
例如:bar: Iterable[int] = (1, 2
浏览 3
提问于2021-06-01
得票数 8
回答已采纳
1
回答
从类型提示中获取原始Python类型
python
、
python-3.x
、
types
、
type-hinting
我使用的是像Tuple[int,...]一样的现代Python类型提示。我需要在某个地方获得原始的Python类型(tuple,list...)来自给定的类型提示变量。例如:
浏览 1
提问于2016-10-23
得票数 4
1
回答
检查数据类的泛型python类型
python
、
typing
对于给定的python代码:import
typing
class Foo: class Bar(
typing
.Generic[T]): Buz =
浏览 1
提问于2019-10-21
得票数 2
1
回答
绕开"
typing
.Union不是泛型类“
python
、
python-3.x
、
type-hinting
在Python的
typing
模块中,似乎任何不是类型的东西都不支持订阅:>>> from yarl import URL >>>
typing
.List[StrOrURL] # OK; List is generic
typing
.List[
typing
.Union[yar
浏览 2
提问于2019-01-08
得票数 6
回答已采纳
1
回答
typing
.Optional的类型是什么?
python
、
python-3.x
然而,我在Python3.6.8中遇到了这个问题type(a)type(a) ==
typing
.UnionOut[14]: FalseOut[23]: Falserepr(type(a)) Out[25]: '
typin
浏览 0
提问于2019-03-13
得票数 8
回答已采纳
2
回答
角点击事件绑定不能正常工作。
html
、
angular
、
typescript
<div class="col-md-3"> <input type="radio" name="colors" [(ngModel)]="
typing
" (click)= "checktype(
typing
)" value="Agent">Agent<br> <input type=&qu
浏览 9
提问于2019-10-30
得票数 2
回答已采纳
1
回答
在python和类型中动态检查参数类型
python
、
python-typing
我有一个具有某种管道结构的类,我希望有一个函数来检查管道中的步骤是否兼容。因此,我希望遍历所有步骤,并在类型提示的情况下检查输入是否与上一步的输出兼容。现在,这是通过从签名中提取类型并比较这些类型来完成的。问题是,我如何比较这些类型?好像因为某种原因我找不到任何办法。例如,Any不能与issubclass一起使用。我使用python3.8。我希望它能在以下情况下发挥作用:is_compatible(List[np.ndarray], List[Union[np.ndarray, list]]) # => Tru
浏览 0
提问于2021-08-26
得票数 1
回答已采纳
1
回答
如何键入值本身为类型提示的变量?
python
、
python-3.x
、
type-hinting
我有一个函数,它的参数之一应该是类型提示:类似于
typing
.List或
typing
.List[int],甚至只是int。您合理地期望将其视为普通字段的类型注释的任何内容。
浏览 17
提问于2022-09-18
得票数 1
回答已采纳
1
回答
如何在Python中检查对象是否可以用作类型批注?
python
、
typing
types defined in `types` modulev: None # None is a value, but ok v:
typing
.List
浏览 21
提问于2021-07-18
得票数 1
1
回答
第一个参数的属性类型由第二个字符串键参数决定的类型保护函数(例如,key="Dict",然后-> TypeGuard["Dict"])?
python
、
typeguards
我试图将JSON数据解析为Pydantic类对象。问题是数据就像 val: Union[Dict, SubData1, SubData2]我正在考虑创建一个类型保护函数(check_type)并使用它,如下所示: value = data.val ## type chec
浏览 4
提问于2021-12-20
得票数 0
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
python typing模块的介绍
Windows10语音输入提升 加入Voice Typing
3 个提高 Python 开发效率的小工具
【行业资讯】SQLAlchemy 2.0.7 发布,Python ORM 框架
静态类型检查器 Mypy 0.620 发布,支持 Data Classes
热门
标签
更多标签
云服务器
即时通信 IM
ICP备案
对象存储
实时音视频
活动推荐
运营活动
广告
关闭
领券