I have four lens with the Ricoh retractable P pin and three of them are tested with no problems of getting stuck in my Pentax digital bodies. But Steve's caution is very much right on checking if the pin is retractable and that if it is a ball head type of pin as shown in this picture
The P pin does't serve equivalent to 'A' when mounted on Pentax bodies. The F-- will show though I seem to use it in Av mode like M42 lens. But there are variants of lenses that support both the Ricoh K-mount with P and the Pentax K-mount with A. If you are interested in manual Pentax film bodies or Ricoh xr series of film bodies, those P lens are worth considering as the pin (retractable or not) will not cause harm as they would on digital bodies where the AF/MF connector has a grove that may get the pin to stuck upon mounting. Those Pentax film bodies will take on the P lens as a manual K mount and meter in Av mode without any problem. It is unlike the crippled KAF2 mount in K10D/K20D/K-7/K-x that are inferior to the older K mount, and the newer digital bodies need to do stop-down metering in M mode.
There are fine gems in Ricoh lenses if you research into it. The pre-xr series of Ricoh mount is similar if not identical to Pentax K mount and it does not have the P pin. Those Ricoh lenses usually don't bear the 'P' signature. And the P pin comes with the Ricoh later models with added programmed mode. Some Cosina and Sigma primes are seen with both the P pin for Ricoh and A pin for Pentax and those are quite good to get -- your mileage will vary from my opinion as I love those lens that work on both Pentax as KA lens and allow Programmed mode in my Ricoh xr-p.
Caution should be taken in consideration of the Ricoh P lenses if you are intended to use the Ricoh P lenses on your digital bodies. If indeed the pin get stuck, simple first measure include gentle wiggle and toggling AF/MF switch to have a chance to push back the pin while sliding the lens to clearance position of the mount.
Thanks,
Hin