Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
Python - 如何查询定义方法的类?
我的问题有点类似于this one https stackoverflow com questions 5520580 how do you get all classes defined in a module but not impor
python
Methods
introspection
inspect
使用反射的属性类型或类
我想知道是否可以确定对象属性的类或原始类型 获取所有属性名称和值非常容易 所以答案 https stackoverflow com questions 2299841 objective c introspection reflection
Objectivec
Reflection
deserialization
introspection
Haskell:确定函数数量的函数?
可以写一个函数吗arity a gt Integer确定任意函数的数量 使得 gt arity map 2 gt arity foldr 3 gt arity id 1 gt arity hello 0 是的 这可以非常非常容易地完成 ar
Haskell
introspection
arity
为什么 Ruby 使用 respond_to?而不是respond_to?
我很好奇为什么 Ruby 用于检查对象是否响应方法的内省相关方法是respond to 代替responds to 我总是觉得很尴尬 但也许那是因为我已经习惯了respondsToSelector在 Objective c 中 Matz p
ruby
namingconventions
introspection
查找模块中显式定义的函数 (python)
好的 我知道您可以使用 dir 方法列出模块中的所有内容 但是有什么方法可以仅查看该模块中定义的函数吗 例如 假设我的模块如下所示 from datetime import date datetime def test return Thi
python
introspection
向 Python 函数添加属性的最佳方法
以计算数学函数的 Python 函数为例 def func x a b c Return the value of the quadratic function ax 2 bx c return a x 2 b x c 假设我想以函数属性的
python
python3x
function
introspection
Ruby on Rails:如何检查复数形式和单一形式的名称
我用命令创建了一个匿名模型 rails g model Anonymous section id integer aid string fake bool active bool 但迁移中的表名称为匿名 class CreateAnonym
rubyonrails
rubyonrails3
introspection
pluralize
如何在 Perl 中循环访问类的所有方法?
如何在 Perl 中循环访问一个类的所有方法 有没有关于 Perl 内省或反射的好的在线参考 Todd Gardner 使用 Moose 的建议很好 但他选择的示例代码并不是很有帮助 如果你正在检查一个非 Moose 使用类 你会这样做 u
perl
Reflection
introspection
为什么在访问 Python 对象属性时使用 getattr() 而不是 __dict__ ?
在具有一定程度的 Python 对象自省的源代码示例和 SO 答案中 常见的模式是 getattr some object attribute name string 是否有理由优先选择这种模式 some object dict attri
python
introspection
检查 Objective-C 块类型?
这主要是出于好奇 我不太确定它的实际用途是什么 但就这样吧 由于块也是 Objective C 对象 是否可以检查它们的类型 也就是说 它是否响应isKindOfClass 消息以及如何使用该消息来处理块 我天真的以为事情大概是这样的 vo
Objectivec
OOP
closures
objectivecblocks
introspection
Google Apps 脚本是否允许任何类型的内省?
Google Apps 脚本可以学习自己的名称吗 或者它的ID 它可以获取其包含文件夹的 ID 吗 它可以了解它在文件夹层次结构中的位置吗 脚本 A 可以获取 设置脚本 B 的属性吗 脚本 A 可以编辑脚本 B 使用的库的任何方面吗 脚本
googleappsscript
introspection
SQLAlchemy ORM 类/对象的自省
我正在寻找一种方法来内省 SQLAlchemy ORM 类 实体 以确定实体属性的类型和其他约束 如最大长度 例如 如果我有一个声明性类 class User Base tablename USER TABLE id sa Column s
python
sqlalchemy
introspection
使用字典自动填充 Objective C 实例的所有属性
我有一个类 其中包含我想从字典中设置值的属性 换句话说 我想自动化这个 objectInstace val1 dict objectForKey val1 objectInstace val2 dict objectForKey val2
Objectivec
introspection
如何获取当前模块内某个类的所有实例
我有一个模块foo定义一个类Foo 并实例化该类的多个实例 从其他模块 我可以import foo并获得一个列表Foo实例化的对象 getattr foo f for f in dir f if isinstance getattr foo
python
module
introspection
如何获取方法参数名称?
假设有一个函数a method被定义为 def a method arg1 arg2 pass 从 开始a method本身 我如何获取参数名称 例如 作为字符串元组 例如 arg1 arg2 看看inspect http docs pyt
python
decorator
introspection
pythondatamodel
如何检查 python 函数是否发生更改(在实时代码中)?
如果我有一个函数的引用 我可以检查它的代码对象f code 获取签名 然后针对此签名执行后续检查以查看代码是否已更改 这很好 但是 如果函数的依赖项之一发生变化怎么办 例如 def foo a b return bar a b 比方说foo
python
Reflection
introspection
如何检查 Ruby 对象的方法?
我想知道是否有一个 Ruby 方法调用仅显示由其调用的 Ruby 对象定义的方法 而不是由其祖先类定义的所有方法 这就是methods似乎是这样 methods采用可选的布尔参数 该参数指定是否还列出对象的类及其超类的方法或仅列出对象的单例
ruby
introspection
如何检查变量是否是类的实例?
在Java中 你可以这样做instanceof 有 Ruby 等价的吗 几乎一模一样 您可以使用Object s instance of method a instance of String gt true a instance of O
ruby
inheritance
introspection
WinRT 反射 (C++/CX)
如何内省 C CX 中的对象 我知道如何获取其类名 使用 IInspectable 但我无法弄清楚如何获取其属性列表 或者如果我只有方法名称 字符串 则如何调用方法 我在这里和 Google 中搜索了答案 但我发现与 WinRT 的 NET
Reflection
windowsruntime
introspection
ccx
获取字符串形式的属性名称
我需要一种方法来传递属性并获取分配给它的名称 有什么建议么 property nonatomic retain MyObject crazyObject NSString str SOME WAY TO GET PROPERTY NAME
Objectivec
introspection
objectivecruntime
declaredproperty
1
2
3
4
5
»