faces directions from normals not from triangle winding?

this code will add a plane:

import bpy

verts  =  [[1,1,0], [1,-1,0], [-1,-1,0], [-1,1,0]]
normals = [[0,0,1], [0,0,1], [0,0,-1], [0,0,-1]]
faces = [[0,1,2],[2,3,0]]

me = bpy.data.meshes.new("test")
me.from_pydata(verts, [], faces)

#add normals (no effect at all)
for i in range(len(normals)): me.vertices[i].normal = normals[i]
##me.vertices.foreach_set("normal", bpy_extras.io_utils.unpack_list(normals))

bpy.context.scene.objects.link(bpy.data.objects.new('test', me)) #add created obj to scene

as you can see in code - two normal vectors are pointing up and two down, but blender is showing me this picture in which all normals are pointing down:


blender ignores(?) the imported normals, and calculate the normals from the triangle winding. and i’m trying to import from a format that has random triangle winding.

though from the python console i can see that the imported normals are here.

what’s going on. how do i force blender to use imported normals instead of triangle winding to calculate the face direction ?

The mesh data you modified isn’t the mesh data used for editing. When entering Edit Mode, there is a conversion and all the normals will be recalculated. Blender doesn’t really support editing normals, you can only modify them from outside Edit Mode and use them e.g for rendering.