from django.test import TestCase # Create your tests here. import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "day53.settings") import django django.setup() from app01 import model
我在C#官方文档的使用属性里看到这种代码: public class Date { private int _month = 7; // Backing store public int Month { get => _month; set { if ((value > 0) && (value < 13)) { _month = value; } } } } 这段代码里的_month是以下划线开头的,用来表示private.这样做会有什么问题呢? 项目混合使用了驼峰命名