2

I'm working in python with a c# library I occasionally have to edit. In python, booleans are specified as True/False. In c#, as true/false. This is driving me crazy. Is there a way to use #define or something to make c# recognize True/False as true/false?

Carbon
  • 3,828
  • 3
  • 24
  • 51

1 Answers1

2

One way is to declare a constant that reflects the true value.

public const bool True = true;

I personally wouldn't go down this path though as it seems to be more like a personal choice. It may confuse other developers and doesn't add general value.

Quality Catalyst
  • 6,531
  • 8
  • 38
  • 62