Skip to content

Commit

Permalink
Extract the class name
Browse files Browse the repository at this point in the history
  • Loading branch information
CLOVIS-AI committed Jun 14, 2022
1 parent d5c7502 commit 38f0a59
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyo3-macros-backend/src/pyclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::pymethod::{
};
use crate::utils::{self, get_pyo3_crate, PythonDoc};
use crate::PyFunctionOptions;
use proc_macro2::{Span, TokenStream};
use proc_macro2::{Literal, Span, TokenStream};
use quote::{format_ident, quote};
use syn::ext::IdentExt;
use syn::parse::{Parse, ParseStream};
Expand Down Expand Up @@ -1006,13 +1006,15 @@ fn generate_class_info(
let class_field_info = format_ident!("{}_struct_field_info", ident_prefix);
let class_info = format_ident!("{}_struct_info", ident_prefix);

let name = Literal::string(&*get_class_python_name(cls, args).to_string());

quote! {
const #class_field_info: [pyo3::interface::FieldInfo; 0] = [
//TODO
];

const #class_info: pyo3::interface::ClassInfo = pyo3::interface::ClassInfo {
name: "", //TODO
name: #name,
base: "", //TODO
fields: &#class_field_info,
};
Expand Down

0 comments on commit 38f0a59

Please sign in to comment.