The following, based on the approach suggested by John Sirola, solves the above issue, although PyCharm shows a warning (see the comment):
m.periods = pe.Param(domain=pe.PositiveIntegers, default=3) # number of planning periods
# noinspection PyTypeChecker
# warning: pe.Param used instead of expected int (but a cast to the latter cannot be used in Abstract model)
m.periods_ = pe.Param(initialize=m.periods-1) # index of the last planning periods
m.P = pe.RangeSet(0, m.periods_) # set of periods; NOTE: RangeSet(0, 1) has two elements, RangeSet(0, -1) is empty
I thank John for the advice, which solved the problem. The PyCharm warning can easily be suppressed, if there is no easy way to cast (in abstract model) pe.Param into int.