machine.Pin doesn't have a pin() method on the ESP32 port
As reported in the Slack channel, the ESP32 port lacks a method to retrieve the pin number.
(It's possible to print the pin object but this is fragile and requires that the number be parsed from the string.)
The nRF and stm32 ports both have a pin() method on a Pin; the same should exist for the ESP32.
[ESP32] machine.ADC should be able to be initialised with pin numbers as well as machine.Pin
See the Documentation for ESP32 forum post. It appears that for at least the PyBoard/STM32 and ESP8266 ports machine.ADC can be initialized by either a pin number (int) or from an instance of machine.Pin. The ESP32 port only allows an instance of machine.Pin for ADC init.
I suggest we allow the ESP32 port to also accept pin numbers:
>>> import machine
>>> a = machine.ADC(35) # Currently fails. Instead must use:
>>> a = machine.ADC(machine.Pin(35))
Either of those last two lines should operate correctly.
(Incidentally I prefer the ESP32 behaviour of only accepting machine.Pin but consistency is more important in this case.)
Note that there are efforts to overhaul the ADC interface (See #3943 and #4213). The proposed change above could be introduced in a shorter time frame, maybe even for v1.10 (see #4356) and ought to complement the upcoming overhaul.