[New-bugs-announce] [issue31816] Unexpected behaviour of `dir()` after implementation of __dir__

Nils Diefenbach report at bugs.python.org
Thu Oct 19 03:48:26 EDT 2017

New submission from Nils Diefenbach <23okrs20+python at mykolab.com>:

When defining a custom __dir__ method in a class, calling dir() on
said class still sorts the output. This is, imo, unexpected behaviour, especially if the order of output was specified in __dir__ and is somehow relevant.

Example and more detail here

messages: 304606
nosy: nlsdfnbch
priority: normal
severity: normal
status: open
title: Unexpected behaviour of `dir()` after implementation of __dir__
type: behavior
versions: Python 3.5

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list