|**Stock-based compensation (Tables)**                                | 3 Months Ended                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
|-------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|**Share-Based Payment Arrangement [Abstract]**                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Summarized Activity Related to Stock Options                         | The following table summarizes activity related to stock options for the three months ended January 31, 2025:Number ofOptionsWeighted-AverageExercise Price Per ShareAggregateIntrinsic ValueWeightedAverageRemainingTermOutstanding at October 31, 2024855$167.26Granted60209.73Exercised(10)114.34Forfeited or expired(1)238.80Outstanding at January 31, 2025904$170.65$50,5404.9 yearsExpected to vest153$230.88$6318.8 yearsExercisable at January 31, 2025748$158.11$49,8894.0 years
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Outstanding at October 31, 2024                                      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Granted                                                              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Exercised                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Forfeited or expired                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Outstanding at January 31, 2025                                      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Expected to vest                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Exercisable at January 31, 2025                                      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|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:Three Months EndedJanuary 31, 2025January 31, 2024Expected volatility30.3%-31.2%30.5%-31.7%Expected dividend yield1.51%-1.51%1.15%-1.15%Risk-free interest rate4.43%-4.48%4.22%-4.26%Expected life of the option (in years)5.0-6.35.0-6.2                                                                                              
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Three Months Ended                                                   | January 31, 2025                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
|Expected volatility                                                  | 30.3%                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
|Expected dividend yield                                              | 1.51%                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
|Risk-free interest rate                                              | 4.43%                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
|Expected life of the option (in years)                               | 5.0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
|Summarized Activity Related to Restricted Stock Units                | The following table summarizes activity related to restricted share units during the three months ended January 31, 2025:Number of UnitsWeighted-AverageGrant Date Fair ValueRestricted share units at October 31, 202467$238.83Granted47239.34Forfeited(1)246.79Vested(26)248.00Restricted share units at January 31, 202587$236.32                                                                                                                                                      
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Restricted share units at October 31, 2024                           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Granted                                                              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Forfeited                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Vested                                                               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Restricted share units at January 31, 2025                           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Summarized Activity Related to Director Deferred Compensation Shares | The following table summarizes activity related to director deferred compensation share equivalent units during the three months ended January 31, 2025:Number of SharesWeighted-AverageGrant Date Fair ValueOutstanding at October 31, 202465$115.66Restricted stock units vested1241.19Distributions(1)77.16Outstanding at January 31, 202565$117.80                                                                                                                                    
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Outstanding at October 31, 2024                                      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Restricted stock units vested                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Distributions                                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
|Outstanding at January 31, 2025                                      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

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 -Topic 718 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Subparagraph (c)(2) -Publisher FASB -URI https://asc.fasb.org/1943274/2147480429/718-10-50-2+ 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 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 -Name Accounting Standards Codification -Topic 718 -SubTopic 10 -Section 50 -Paragraph 2 -Subparagraph (g) -Publisher FASB -URI https://asc.fasb.org/1943274/2147480429/718-10-50-2+ 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 -Topic 718 -SubTopic 10 -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Subparagraph (c)(1) -Publisher FASB -URI https://asc.fasb.org/1943274/2147480429/718-10-50-2Reference 2: http://fasb.org/us-gaap/role/ref/legacyRef -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Subparagraph (d) -SubTopic 10 -Topic 718 -Publisher FASB -URI https://asc.fasb.org/1943274/2147480429/718-10-50-2Reference 3: http://fasb.org/us-gaap/role/ref/legacyRef -Name Accounting Standards Codification -Section 50 -Paragraph 2 -Subparagraph (e) -SubTopic 10 -Topic 718 -Publisher FASB -URI https://asc.fasb.org/1943274/2147480429/718-10-50-2+ 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 -Topic 718 -SubTopic 10 -Subparagraph (f)(2) -Name Accounting Standards Codification -Paragraph 2 -Section 50 -Publisher FASB -URI https://asc.fasb.org/1943274/2147480429/718-10-50-2+ Details**Name:**us-gaap_ScheduleOfShareBasedPaymentAwardStockOptionsValuationAssumptionsTableTextBlock**Namespace Prefix:**us-gaap_**Data Type:**dtr-types:textBlockItemType**Balance Type:**na**Period Type:**duration