Top "Attributes" questions

The attributes tag should be used for any issues relating to a property of an object, element, or file, etc.

Custom Assembly Attributes

I would like to know if I can define custom assembly attributes. Existing attributes are defined in the following way: […

c# .net assemblies attributes
Is __attribute__ ((__packed__)) ignored on a typedef declaration?

Though __attribute__ ((aligned)) works well with the typedef declaration such as : typedef struct __attribute__((__aligned__(8))) A { xxx ip ; xxx udp ; …

c data-structures attributes typedef
How can I return a default value for an attribute?

I have an object myobject, which might return None. If it returns None, it won't return an attribute id: a = …

python reflection attributes default void
How to create duplicate allowed attributes

I'm using a custom attribute inherited from an attribute class. I'm using it like this: [MyCustomAttribute("CONTROL")] [MyCustomAttribute("ALT")] [MyCustomAttribute("…

c# attributes
What's the difference between using the Serializable attribute & implementing ISerializable?

What's the difference between using the Serializable attribute and implementing the ISerializable interface?

c# inheritance attributes serialization iserializable
Property binding vs attribute interpolation

I have read an article about difference between property and attribute bindings. From what I understood, most of the time, …

angular binding properties attributes interpolation
Inspect python class attributes

I need a way to inspect a class so I can safely identify which attributes are user-defined class attributes. The …

python class attributes introspection inspect
What's the difference between a global var and a window.variable in javascript?

I'm reading the backbone.js documents and seeing a lot of code that assigns attributes to the window object: window.…

javascript attributes scope
jquery change attribute

i have 4 links and i need to change the href attribute in a rel attribute. i know i cannot do …

jquery attributes href rel
hasattr() vs try-except block to deal with non-existent attributes

if hasattr(obj, 'attribute'): # do somthing vs try: # access obj.attribute except AttributeError, e: # deal with AttributeError Which should be …

python exception exception-handling attributes hasattr