|**Stock-based compensation (Tables)**                                | 6 Months Ended                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
|-------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|**Share-based Payment Arrangement [Abstract]**                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Summarized Activity Related to Stock Options                         | The following table summarizes activity related to stock options for the six months ended April 30, 2022:Number ofOptionsWeighted-AverageExercise Price Per ShareAggregateIntrinsic ValueWeightedAverageRemainingTermOutstanding at October 31, 20211,235$130.93Granted83267.51Exercised(68)115.99Forfeited or expired(14)204.77Outstanding at April 30, 20221,236$140.12$97,3855.8 yearsExpected to vest380$185.05$15,5657.5 yearsExercisable at April 30, 2022854$119.99$81,7115.0 years
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Outstanding at October 31, 2021                                      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Granted                                                              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Exercised                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Forfeited or expired                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Outstanding at April 30, 2022                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Expected to vest                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Exercisable at April 30, 2022                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Fair Value Assumptions of Stock Options                              | The fair value of each option grant was estimated at the date of grant using the Black-Scholes option-pricing model with the following assumptions:Six Months EndedApril 30, 2022April 30, 2021Expected volatility30.6%-30.8%30.8%-32.6%Expected dividend yield0.76%-0.76%0.83%-0.85%Risk-free interest rate1.36%-1.47%0.43%-0.77%Expected life of the option (in years)5.3-6.25.3-6.2                                                                                                    
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Six Months Ended                                                     | April 30, 2022                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
|Expected volatility                                                  | 30.6%                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
|Expected dividend yield                                              | 0.76%                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
|Risk-free interest rate                                              | 1.36%                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
|Expected life of the option (in years)                               | 5.3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
|Summarized Activity Related to Restricted Stock                      | The following table summarizes activity related to restricted shares during the six months ended April 30, 2022:Number of SharesWeighted-AverageGrant Date Fair ValueRestricted shares at October 31, 202119$157.36Vested(10)146.50Restricted shares at April 30, 20229$171.11                                                                                                                                                                                                            
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Restricted shares at October 31, 2021                                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Vested                                                               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Restricted shares at April 30, 2022                                  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Summarized Activity Related to Restricted Stock Units                | The following table summarizes activity related to restricted share units during the six months ended April 30, 2022:Number of UnitsWeighted-AverageGrant Date Fair ValueRestricted share units at October 31, 202167$202.81Granted41263.75Forfeited(8)221.84Vested(15)201.79Restricted share units at April 30, 202285$230.34                                                                                                                                                            
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Restricted share units at October 31, 2021                           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Granted                                                              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Forfeited                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Vested                                                               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Restricted share units at April 30, 2022                             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Summarized Activity Related to Director Deferred Compensation Shares | The following table summarizes activity related to director deferred compensation share equivalent units during the six months ended April 30, 2022:Number of SharesWeighted-AverageGrant Date FairValueOutstanding at October 31, 2021106$68.11Distributions(7)48.01Outstanding at April 30, 202299$70.81                                                                                                                                                                                
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Outstanding at October 31, 2021                                      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Distributions                                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Outstanding at April 30, 2022                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

X- ReferencesNo definition available.
+ Details**Name:**
us-gaap_DisclosureOfCompensationRelatedCostsSharebasedPaymentsAbstract**Namespace Prefix:**
us-gaap_**Data Type:**
xbrli:stringItemType**Balance Type:**
na**Period Type:**
duration X- DefinitionTabular disclosure of the changes in outstanding nonvested restricted stock units.
+ ReferencesReference 1: http://fasb.org/us-gaap/role/ref/legacyRef -Publisher FASB -Name Accounting Standards Codification -Topic 718 -SubTopic 10 -Section 50 -Paragraph 2 -Subparagraph (c)(2) -URI http://asc.fasb.org/extlink&oid=120381028&loc=d3e5070-113901
+ Details**Name:**
us-gaap_ScheduleOfNonvestedRestrictedStockUnitsActivityTableTextBlock**Namespace Prefix:**
us-gaap_**Data Type:**
dtr-types:textBlockItemType**Balance Type:**
na**Period Type:**
duration X- DefinitionTabular disclosure of the changes in outstanding nonvested shares.
+ ReferencesReference 1: http://fasb.org/us-gaap/role/ref/legacyRef -Publisher FASB -Name Accounting Standards Codification -Topic 718 -SubTopic 10 -Section 50 -Paragraph 2 -Subparagraph (c)(2) -URI http://asc.fasb.org/extlink&oid=120381028&loc=d3e5070-113901
+ Details**Name:**
us-gaap_ScheduleOfNonvestedShareActivityTableTextBlock**Namespace Prefix:**
us-gaap_**Data Type:**
dtr-types:textBlockItemType**Balance Type:**
na**Period Type:**
duration X- DefinitionTabular disclosure of the number and weighted-average exercise prices (or conversion ratios) for stock awards granted to nonemployee directors that were outstanding at the beginning and end of the year, and the number of awards that were granted, exercised or converted, forfeited, and expired during the year.
+ ReferencesReference 1: http://fasb.org/us-gaap/role/ref/legacyRef -Publisher FASB -Name Accounting Standards Codification -Topic 718 -SubTopic 10 -Section 50 -Paragraph 2 -Subparagraph (g) -URI http://asc.fasb.org/extlink&oid=120381028&loc=d3e5070-113901
+ Details**Name:**
us-gaap_ScheduleOfShareBasedCompensationNonemployeeDirectorStockAwardPlanActivityTableTextBlock**Namespace Prefix:**
us-gaap_**Data Type:**
dtr-types:textBlockItemType**Balance Type:**
na**Period Type:**
duration X- DefinitionTabular disclosure for stock option plans. Includes, but is not limited to, outstanding awards at beginning and end of year, grants, exercises, forfeitures, and weighted-average grant date fair value.
+ ReferencesReference 1: http://fasb.org/us-gaap/role/ref/legacyRef -Publisher FASB -Name Accounting Standards Codification -Topic 718 -SubTopic 10 -Section 50 -Paragraph 2 -Subparagraph (d) -URI http://asc.fasb.org/extlink&oid=120381028&loc=d3e5070-113901Reference 2: http://fasb.org/us-gaap/role/ref/legacyRef -Publisher FASB -Name Accounting Standards Codification -Topic 718 -SubTopic 10 -Section 50 -Paragraph 2 -Subparagraph (e) -URI http://asc.fasb.org/extlink&oid=120381028&loc=d3e5070-113901Reference 3: http://fasb.org/us-gaap/role/ref/legacyRef -Publisher FASB -Name Accounting Standards Codification -Topic 718 -SubTopic 10 -Section 50 -Paragraph 2 -Subparagraph (c)(1) -URI http://asc.fasb.org/extlink&oid=120381028&loc=d3e5070-113901
+ Details**Name:**
us-gaap_ScheduleOfShareBasedCompensationStockOptionsActivityTableTextBlock**Namespace Prefix:**
us-gaap_**Data Type:**
dtr-types:textBlockItemType**Balance Type:**
na**Period Type:**
duration X- DefinitionTabular disclosure of the significant assumptions used during the year to estimate the fair value of stock options, including, but not limited to: (a) expected term of share options and similar instruments, (b) expected volatility of the entity's shares, (c) expected dividends, (d) risk-free rate(s), and (e) discount for post-vesting restrictions.
+ ReferencesReference 1: http://fasb.org/us-gaap/role/ref/legacyRef -Publisher FASB -Name Accounting Standards Codification -Topic 718 -SubTopic 10 -Section 50 -Paragraph 2 -Subparagraph (f)(2) -URI http://asc.fasb.org/extlink&oid=120381028&loc=d3e5070-113901
+ Details**Name:**
us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock**Namespace Prefix:**
us-gaap_**Data Type:**
dtr-types:textBlockItemType**Balance Type:**
na**Period Type:**
duration