0

I'm having trouble setting the sequential attribute for a field to False. My code includes the following.

LABEL = data.Field(sequential=False)

But when I check whether sequential is False or not...

hasattr(LABEL, 'sequential')

I get "True". When I try to set the attribute...

LABEL.sequential = False
hasattr(LABEL, 'sequential')

I still get True!

Any help would be much appreciated!

TKT
  • 31
  • 5

1 Answers1

0

Good catch ! There are some texts talking about problems in hasattr() like:

  1. Python hasattr vs getattr
  2. hasattr() – A Dangerous Misnomer

Instead, you can use getattr() and you will see the correct result.

mausamsion
  • 230
  • 1
  • 8