Is it possible to add a custom property on bpy.types.Sequence?
Update: bpy.types.SequenceProperties  is supported in 2.75 (or recent builds)

The information below is kept since the answer still applies to types such as bpy.types.TimelineMarker or bpy.types.Modifier.



In short - no. You can only add custom data properties on:


ID (its subclasses Action, Armature, Brush, Camera, Curve, FreestyleLineStyle, GreasePencil, Group, Image, Key, Lamp, Lattice, Library, Mask, Material, Mesh, MetaBall, MovieClip, NodeTree, Object, PaintCurve, Palette, ParticleSettings, Scene, Screen, Sound, Speaker, Text, Texture, VectorFont, WindowManager, World', etc...)Try run: bpy.types.ID.__subclasses__() to see all.
Bones
PoseBones
AddonPrefs
Node, NodeSocket, NodeSocketInterface
OperatorProperties.


The reason this gives confusing output is that the initial assignment is using Pythons regular class assignment, in this case its not using a metaclass (which would interpret the property definitions and apply them as you are expecting).

bpy.types.Sequence.foobar = 22
print(bpy.context.sequences[0].foobar)
# &gt;&gt;&gt; 22
bpy.context.sequences[0].foobar = 11 # &lt;-- will error!
# AttributeError: 'SceneSequence' object attribute 'foobar' is read-only


So why use this at all?
- Because it allows you to add utility methods &amp; properties at run-time. Note that this is standard python and nothing Blender specific (unlike custom properties).

bpy.types.Sequence.calc_frame_mid = (lambda seq:
        (seq.frame_final_start + seq.frame_final_end) / 2)

print(bpy.context.sequences[0].calc_frame_mid())


... you can add Python style properties too.

Note, adding methods and properties to existing data types is known as Monkey Patching and often considered bad practice, however you can also use this to dynamically build up functionality into classes you generate for instance, so it can be used in some interesting/useful ways too.

If you modify Blenders built in types it will make the changes globally so beware it could break other scripts or even make Blender fail to use its own API's correctly, so this is really advanced api usage.