How can I type hint an attribute in Python 3.5?

In Python 3.5, you have to write self.some_attribute = None # type: AnotherClass Since Python 3.6, new type hinting syntax was added for variables (PEP 526): self.some_attribute: AnotherClass = None This will probably make every type-checking system complain, because None is in fact not an instance of AnotherClass. Instead, you can use typing.Union[None, AnotherClass], or … Read more

Are function attributes inherited?

I sent an email to the C++ committee, specifically the Core working group, and provided the above example. CoryKramer It is currently unclear from the standard if attributes applied to virtual functions are inherited. Response: They are not. For them to be inherited, the Standard would have to explicitly say so, and it does not. … Read more

Why can’t I comment attributes in XAML?

Though you can’t comment out using the basic XAML markup, you can achieve the desired results by importing the Open XML markup namespace. xmlns:mc=”http://schemas.openxmlformats.org/markup-compatibility/2006″ xmlns:ignore=”http://www.galasoft.ch/ignore” mc:Ignorable=”ignore” <Label x:Name=”Gaga” FontSize=”20″ ignore:Content=”{Binding SomethingThatIsEmptyAtDesignTime}” Content=”LookAtMe!” /> This blog post describes how to do it.