提示 问答列表

为什么 TypedDict 调用 update 方法时 mypy 不通过

作者:zyxue 提问时间:10/22/2021

例: from typing import TypedDict class MyType(TypedDict): a: int b: int t = MyType(a=1, b=2) t....

Pybind11 模块中的函数签名/接口(IDE 建议)

作者:Phil-ZXX 提问时间:3/14/2022

假设我们有一个简单的模块,称为使用 pybind11 构建:_sample /* py_bindings.cpp */ #include <pybind11/pybind11.h> namespa...

意外类型:(int, bytes) 可能的类型:(SupportsIndex, SupportsIndex) (slice, Iterable[SupportsIndex] | bytes)

作者:songofhawk 提问时间:9/26/2023

当我在下面写一个python功能时: def readinto(self, b: bytearray) -> int: n, size = 0, len(b) while n < size: ...

在 TypeVar 上绑定 TypeVar 的解决方法?

作者:joel 提问时间:8/21/2019

有没有办法用 Python 的类型提示来表达这个 Scala 代码? trait List[A] { def ::[B >: A](x: B): List[B] } 我正在努力实现这种事情 ...

如何只键入 Protocol 方法的第一个位置参数并让其他参数取消类型化?

作者:giuliano-oliveira 提问时间:12/25/2022

问题 如何只键入 Protocol 方法的第一个位置参数并让其他参数取消类型化? 例如,有一个名为的协议,该方法的名称只需要第一个位置参数是 int,而让其余参数是非类型化的。 以下类将正确实现它...

Tippy.js 不显示数据属性中的内容?

作者:lky 提问时间:4/17/2019

我已经安装了 tippy.js 来处理我的工具提示,但是我正在努力获取工具提示来显示数据属性中的内容集。我的默认工具提示工作正常,但是当我通过类初始化时,为了能够向工具提示添加不同的样式,它不会从工具...

WPF - ErrorTemplate 工具提示显示在边框上,但未显示 TextBox

作者:Jean-David Lanz 提问时间:3/23/2023

我有 TextBox 控件,其绑定到整数属性。他们就像: <TextBox x:Name="txtInteger" Grid.Row="2" Grid.Column="0" Text="{Bi...

如何在Python中注释具有泛型类型的泛型类型?

作者:makpia 提问时间:6/14/2023

我正在编写一个模仿 Rust 中的迭代器的 ITER 类型,它有一个 .collect() 方法: # python 3.11 from typing import TypeVar, Generi...

FullCalendar v5 中的 popover 元素

作者:Anonimo 提问时间:7/10/2023

在使用这个较新版本的 fullcalendar 之前,我使用了 element.popover,如下所示: eventRender: function(event, element, view) {...

(Python,Numpy:类型提示),如何正确将“integer”值转换为“_DType@clip”?

作者:Garid 提问时间:7/8/2023

我在类型提示方面遇到了问题。 假设以下代码 ():Numpy (version 1.25)/tmp/asdf.py import numpy as np tx: int = 32 out_tx ...


共54条 当前第5页