Select Pose Bones Per Script In Blender 2.8 Is there a new command for selecting bones when in pose mode?

myPoseBone = bpy.data.objects['metarig'].pose.bones["thigh.R"]
myPoseBone.select = True


does not seem to work (AttributeError: 'PoseBone' obejct has no attribute 'select').

However, everybody seems to do it that way. Does it still work for you?
Thanks in advance,

Matthias
Select the armature bone.
Further to the answer by @yhoho a pose bone has a bpy.types.PoseBone.bone property pointing to its associated armature bone.
Example from python console (where C = bpy.context) , bone of interest has name &quot;Bone&quot;, armature object has context.
When unsure of things the python console is a handy way to interactively see what's what
&gt;&gt;&gt; C.object
bpy.data.objects['Armature']

&gt;&gt;&gt; pb = C.object.pose.bones.get(&quot;Bone&quot;)
&gt;&gt;&gt; pb
bpy.data.objects['Armature'].pose.bones[&quot;Bone&quot;]

its associated armature bone, from its bone property
&gt;&gt;&gt; pb.bone
bpy.data.armatures['Armature'].bones[&quot;Bone&quot;]

Which tells us could also get this via the armature, ie the data part of the armature object.
&gt;&gt;&gt; arm = C.object.data
&gt;&gt;&gt; arm
bpy.data.armatures['Armature']

&gt;&gt;&gt; bone = arm.bones.get(&quot;Bone&quot;)
&gt;&gt;&gt; bone
bpy.data.armatures['Armature'].bones[&quot;Bone&quot;]

The two bones referenced in different ways are equal
&gt;&gt;&gt; bone == pb.bone
True

but are not an instance of same object,
&gt;&gt;&gt; bone is pb.bone
False

A bone from the armature bones collection of type bpy.types.Bone has a select property, whereas a pose bone bpy.types.PoseBone  from an armature objects pose bone collection has not (AFAIK never has).
Hence as shown to select, can use either of
pb.bone.select = True
bone.select = True

The idea of using collection.get(name) is that it returns None if the named item does not exist and can be checked against None (boolean False)  and handled.
&gt;&gt;&gt; pb = C.object.pose.bones.get(&quot;NonExistentBone&quot;)
&gt;&gt;&gt; pb is None
True

Related
Set active bone in pose mode from Python script