I have a function that takes in an integer value and returns a symbolic fraction of it, e.g.,
```
def r(n):
return sympy.Rational(n, 261)
```
I would like to be able to provide integers and sympy.Symbols alike, but the latter fails with
```
TypeError: invalid input: n
```
-- Right, one can simply use `n/261`.
Since Rationals appear quite frequently in my code, I would like to avoid constructions like
```
x = n/261 if isinstance(n, sympy.Atom) else sympy.Rational(n, 261)
```
(where sympy.Atom wouldn't even cover cases like `2n+1` in either numerator or denominator).
Is there a way to support integer and symbolic fractions from one interface?
Cheers,
Nico